diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2023-04-28 14:55:18 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2023-05-30 15:07:26 -0400 |
commit | 2736b77153629619fe75071356e16d9db51606ff (patch) | |
tree | 0fb4dded5c12a31a6ede897d0cf8b2ed4a30a616 /gdb/cli | |
parent | c3d321de3f35dc67d7eb0826e6cc8bc1f22a91e6 (diff) | |
download | fsf-binutils-gdb-2736b77153629619fe75071356e16d9db51606ff.zip fsf-binutils-gdb-2736b77153629619fe75071356e16d9db51606ff.tar.gz fsf-binutils-gdb-2736b77153629619fe75071356e16d9db51606ff.tar.bz2 |
gdb: add interp::on_command_error method
Same idea as the previous patches, but for command_error.
Change-Id: If6098225dd72fad8be13b3023b35bc8bc48efb9d
Diffstat (limited to 'gdb/cli')
-rw-r--r-- | gdb/cli/cli-interp.c | 12 | ||||
-rw-r--r-- | gdb/cli/cli-interp.h | 1 |
2 files changed, 3 insertions, 10 deletions
diff --git a/gdb/cli/cli-interp.c b/gdb/cli/cli-interp.c index 0031054..ffb4072 100644 --- a/gdb/cli/cli-interp.c +++ b/gdb/cli/cli-interp.c @@ -158,15 +158,9 @@ cli_interp_base::on_sync_execution_done () display_gdb_prompt (NULL); } -/* Observer for the command_error notification. */ - -static void -cli_base_on_command_error () +void +cli_interp_base::on_command_error () { - cli_interp_base *cli = as_cli_interp_base (top_level_interpreter ()); - if (cli == nullptr) - return; - display_gdb_prompt (NULL); } @@ -355,8 +349,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::command_error.attach (cli_base_on_command_error, - "cli-interp-base"); gdb::observers::user_selected_context_changed.attach (cli_base_on_user_selected_context_changed, "cli-interp-base"); } diff --git a/gdb/cli/cli-interp.h b/gdb/cli/cli-interp.h index 4680c80..5020b2b 100644 --- a/gdb/cli/cli-interp.h +++ b/gdb/cli/cli-interp.h @@ -39,6 +39,7 @@ public: void on_exited (int status) override; void on_no_history () override; void on_sync_execution_done () override; + void on_command_error () override; private: struct saved_output_files |