aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2023-04-20 15:35:18 -0400
committerSimon Marchi <simon.marchi@efficios.com>2023-05-30 15:07:26 -0400
commit2e5dbfab563c58b9be34d168e8aaa24878aab38c (patch)
treec4037adde2a345e6d6c189630eb5ff442fd403d3 /gdb/cli
parentbf64d1d5bf718859b2687a0a011246b9cbbca9e1 (diff)
downloadbinutils-2e5dbfab563c58b9be34d168e8aaa24878aab38c.zip
binutils-2e5dbfab563c58b9be34d168e8aaa24878aab38c.tar.gz
binutils-2e5dbfab563c58b9be34d168e8aaa24878aab38c.tar.bz2
gdb: add interp::on_no_history method
Same as previous patches, but for no_history. Change-Id: I06930fe7cb4082138c6c5496c5118fe4951c10da
Diffstat (limited to 'gdb/cli')
-rw-r--r--gdb/cli/cli-interp.c16
-rw-r--r--gdb/cli/cli-interp.h1
2 files changed, 4 insertions, 13 deletions
diff --git a/gdb/cli/cli-interp.c b/gdb/cli/cli-interp.c
index 6cb315c..98bc203 100644
--- a/gdb/cli/cli-interp.c
+++ b/gdb/cli/cli-interp.c
@@ -146,19 +146,10 @@ cli_interp_base::on_exited (int status)
print_exited_reason (this->interp_ui_out (), status);
}
-/* Observer for the no_history notification. */
-
-static void
-cli_base_on_no_history ()
+void
+cli_interp_base::on_no_history ()
{
- SWITCH_THRU_ALL_UIS ()
- {
- cli_interp_base *cli = as_cli_interp_base (top_level_interpreter ());
- if (cli == nullptr)
- continue;
-
- print_no_history_reason (cli->interp_ui_out ());
- }
+ print_no_history_reason (this->interp_ui_out ());
}
/* Observer for the sync_execution_done notification. */
@@ -370,7 +361,6 @@ _initialize_cli_interp ()
interp_factory_register (INTERP_CONSOLE, cli_interp_factory);
/* Note these all work for both the CLI and TUI interpreters. */
- gdb::observers::no_history.attach (cli_base_on_no_history, "cli-interp-base");
gdb::observers::sync_execution_done.attach (cli_base_on_sync_execution_done,
"cli-interp-base");
gdb::observers::command_error.attach (cli_base_on_command_error,
diff --git a/gdb/cli/cli-interp.h b/gdb/cli/cli-interp.h
index 2e50860..7fc22a0 100644
--- a/gdb/cli/cli-interp.h
+++ b/gdb/cli/cli-interp.h
@@ -37,6 +37,7 @@ public:
void on_signal_exited (gdb_signal sig) override;
void on_normal_stop (bpstat *bs, int print_frame) override;
void on_exited (int status) override;
+ void on_no_history () override;
private:
struct saved_output_files