diff options
author | Tom Tromey <tom@tromey.com> | 2016-09-24 16:11:14 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2016-10-21 14:17:34 -0600 |
commit | 0e454242cc1527e49ad0ea795614ac94a083b68a (patch) | |
tree | 496037f8b3077158d566d6506b6ac642bbb40281 /gdb/cli | |
parent | 8dddcb8f005e8470312bf33041bb6ddaa5084e32 (diff) | |
download | gdb-0e454242cc1527e49ad0ea795614ac94a083b68a.zip gdb-0e454242cc1527e49ad0ea795614ac94a083b68a.tar.gz gdb-0e454242cc1527e49ad0ea795614ac94a083b68a.tar.bz2 |
Remove make_cleanup_restore_current_ui
This removes make_cleanup_restore_current_ui by converting the last
use. The last use was in a few functions used to iterate over all
UIs. This patch replaces these functions with a class, and arranges
for the class destructor to do the needed cleanup.
2016-10-21 Tom Tromey <tom@tromey.com>
* tui/tui-interp.c (tui_on_normal_stop, tui_on_signal_received)
(tui_on_end_stepping_range, tui_on_signal_exited, tui_on_exited)
(tui_on_no_history, tui_on_user_selected_context_changed):
Update.
* top.h (switch_thru_all_uis): New class.
(SWITCH_THRU_ALL_UIS): Rewrite.
(make_cleanup_restore_current_ui, switch_thru_all_uis_init)
(switch_thru_all_uis_cond, switch_thru_all_uis_next): Don't
declare.
* mi/mi-interp.c (mi_new_thread, mi_thread_exit)
(mi_record_changed, mi_inferior_added, mi_inferior_appeared)
(mi_inferior_exit, mi_inferior_removed, mi_on_signal_received)
(mi_on_end_stepping_range, mi_on_signal_exited, mi_on_exited)
(mi_on_no_history, mi_on_normal_stop, mi_traceframe_changed)
(mi_tsv_created, mi_tsv_deleted, mi_tsv_modified)
(mi_breakpoint_created, mi_breakpoint_deleted)
(mi_breakpoint_modified, mi_output_running_pid, mi_on_resume)
(mi_solib_loaded, mi_solib_unloaded, mi_command_param_changed)
(mi_memory_changed, mi_user_selected_context_changed): Update.
* infrun.c (all_uis_check_sync_execution_done)
(all_uis_on_sync_execution_starting, normal_stop): Update.
* event-top.c (restore_ui_cleanup)
(make_cleanup_restore_current_ui, switch_thru_all_uis_init)
(switch_thru_all_uis_cond, switch_thru_all_uis_next): Remove.
* cli/cli-interp.c (cli_on_normal_stop, cli_on_signal_received)
(cli_on_end_stepping_range, cli_on_signal_exited, cli_on_exited)
(cli_on_no_history, cli_on_user_selected_context_changed):
Update.
* breakpoint.c (watchpoint_check): Update.
Diffstat (limited to 'gdb/cli')
-rw-r--r-- | gdb/cli/cli-interp.c | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/gdb/cli/cli-interp.c b/gdb/cli/cli-interp.c index cc556a4..dfa96d6 100644 --- a/gdb/cli/cli-interp.c +++ b/gdb/cli/cli-interp.c @@ -99,12 +99,10 @@ should_print_stop_to_console (struct interp *console_interp, static void cli_on_normal_stop (struct bpstats *bs, int print_frame) { - struct switch_thru_all_uis state; - if (!print_frame) return; - SWITCH_THRU_ALL_UIS (state) + SWITCH_THRU_ALL_UIS () { struct interp *interp = top_level_interpreter (); struct cli_interp *cli = as_cli_interp (interp); @@ -124,9 +122,7 @@ cli_on_normal_stop (struct bpstats *bs, int print_frame) static void cli_on_signal_received (enum gdb_signal siggnal) { - struct switch_thru_all_uis state; - - SWITCH_THRU_ALL_UIS (state) + SWITCH_THRU_ALL_UIS () { struct cli_interp *cli = as_cli_interp (top_level_interpreter ()); @@ -142,9 +138,7 @@ cli_on_signal_received (enum gdb_signal siggnal) static void cli_on_end_stepping_range (void) { - struct switch_thru_all_uis state; - - SWITCH_THRU_ALL_UIS (state) + SWITCH_THRU_ALL_UIS () { struct cli_interp *cli = as_cli_interp (top_level_interpreter ()); @@ -160,9 +154,7 @@ cli_on_end_stepping_range (void) static void cli_on_signal_exited (enum gdb_signal siggnal) { - struct switch_thru_all_uis state; - - SWITCH_THRU_ALL_UIS (state) + SWITCH_THRU_ALL_UIS () { struct cli_interp *cli = as_cli_interp (top_level_interpreter ()); @@ -178,9 +170,7 @@ cli_on_signal_exited (enum gdb_signal siggnal) static void cli_on_exited (int exitstatus) { - struct switch_thru_all_uis state; - - SWITCH_THRU_ALL_UIS (state) + SWITCH_THRU_ALL_UIS () { struct cli_interp *cli = as_cli_interp (top_level_interpreter ()); @@ -196,9 +186,7 @@ cli_on_exited (int exitstatus) static void cli_on_no_history (void) { - struct switch_thru_all_uis state; - - SWITCH_THRU_ALL_UIS (state) + SWITCH_THRU_ALL_UIS () { struct cli_interp *cli = as_cli_interp (top_level_interpreter ()); @@ -240,7 +228,6 @@ cli_on_command_error (void) static void cli_on_user_selected_context_changed (user_selected_what selection) { - struct switch_thru_all_uis state; struct thread_info *tp; /* This event is suppressed. */ @@ -249,7 +236,7 @@ cli_on_user_selected_context_changed (user_selected_what selection) tp = find_thread_ptid (inferior_ptid); - SWITCH_THRU_ALL_UIS (state) + SWITCH_THRU_ALL_UIS () { struct cli_interp *cli = as_cli_interp (top_level_interpreter ()); |