From 41966608a1ee2bde59772c41aae6ec95b309ff26 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Mon, 24 Apr 2023 15:46:00 -0400 Subject: [PATCH] gdb: remove end_stepping_range observable I noticed that this observable was never notified, which means we can probably safely remove it. The notification was removed in: commit 243a925328f8e3184b2356bee497181049c0174f Author: Pedro Alves Date: Wed Sep 9 18:23:24 2015 +0100 Replace "struct continuation" mechanism by something more extensible print_end_stepping_range_reason in turn becomes unused, so remote it as well. Change-Id: If5da5149276c282d2540097c8c4327ce0f70431a --- gdb/cli/cli-interp.c | 17 ----------------- gdb/infrun.c | 12 ------------ gdb/infrun.h | 4 ---- gdb/mi/mi-interp.c | 20 -------------------- gdb/observable.c | 1 - gdb/observable.h | 3 --- 6 files changed, 57 deletions(-) diff --git a/gdb/cli/cli-interp.c b/gdb/cli/cli-interp.c index 99410147a6c..5a515c603c6 100644 --- a/gdb/cli/cli-interp.c +++ b/gdb/cli/cli-interp.c @@ -151,21 +151,6 @@ cli_base_on_signal_received (enum gdb_signal siggnal) } } -/* Observer for the end_stepping_range notification. */ - -static void -cli_base_on_end_stepping_range () -{ - SWITCH_THRU_ALL_UIS () - { - cli_interp_base *cli = as_cli_interp_base (top_level_interpreter ()); - if (cli == nullptr) - continue; - - print_end_stepping_range_reason (cli->interp_ui_out ()); - } -} - /* Observer for the signalled notification. */ static void @@ -422,8 +407,6 @@ _initialize_cli_interp () /* Note these all work for both the CLI and TUI interpreters. */ gdb::observers::normal_stop.attach (cli_base_on_normal_stop, "cli-interp-base"); - gdb::observers::end_stepping_range.attach (cli_base_on_end_stepping_range, - "cli-interp-base"); gdb::observers::signal_received.attach (cli_base_on_signal_received, "cli-interp-base"); gdb::observers::signal_exited.attach (cli_base_on_signal_exited, diff --git a/gdb/infrun.c b/gdb/infrun.c index b79642e4d1e..2f1c6cd694b 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -8498,18 +8498,6 @@ end_stepping_range (struct execution_control_state *ecs) the interpreters, through observers. Interpreters then call these with whatever uiout is right. */ -void -print_end_stepping_range_reason (struct ui_out *uiout) -{ - /* For CLI-like interpreters, print nothing. */ - - if (uiout->is_mi_like_p ()) - { - uiout->field_string ("reason", - async_reason_lookup (EXEC_ASYNC_END_STEPPING_RANGE)); - } -} - void print_signal_exited_reason (struct ui_out *uiout, enum gdb_signal siggnal) { diff --git a/gdb/infrun.h b/gdb/infrun.h index 9b3c8962939..9513bc570e4 100644 --- a/gdb/infrun.h +++ b/gdb/infrun.h @@ -217,10 +217,6 @@ extern void set_step_info (thread_info *tp, extern void print_signal_received_reason (struct ui_out *uiout, enum gdb_signal siggnal); -/* Print why the inferior has stopped. We are done with a - step/next/si/ni command, print why the inferior has stopped. */ -extern void print_end_stepping_range_reason (struct ui_out *uiout); - /* The inferior was terminated by a signal, print why it stopped. */ extern void print_signal_exited_reason (struct ui_out *uiout, enum gdb_signal siggnal); diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c index 4f0bbd40f9d..ce78b0c2b58 100644 --- a/gdb/mi/mi-interp.c +++ b/gdb/mi/mi-interp.c @@ -61,7 +61,6 @@ static void mi_insert_notify_hooks (void); static void mi_remove_notify_hooks (void); static void mi_on_signal_received (enum gdb_signal siggnal); -static void mi_on_end_stepping_range (void); static void mi_on_signal_exited (enum gdb_signal siggnal); static void mi_on_exited (int exitstatus); static void mi_on_normal_stop (struct bpstat *bs, int print_frame); @@ -542,23 +541,6 @@ mi_on_signal_received (enum gdb_signal siggnal) } } -/* Observer for the end_stepping_range notification. */ - -static void -mi_on_end_stepping_range (void) -{ - SWITCH_THRU_ALL_UIS () - { - struct mi_interp *mi = find_mi_interp (); - - if (mi == NULL) - continue; - - print_end_stepping_range_reason (mi->mi_uiout); - print_end_stepping_range_reason (mi->cli_uiout); - } -} - /* Observer for the signal_exited notification. */ static void @@ -1317,8 +1299,6 @@ _initialize_mi_interp () interp_factory_register (INTERP_MI, mi_interp_factory); gdb::observers::signal_received.attach (mi_on_signal_received, "mi-interp"); - gdb::observers::end_stepping_range.attach (mi_on_end_stepping_range, - "mi-interp"); gdb::observers::signal_exited.attach (mi_on_signal_exited, "mi-interp"); gdb::observers::exited.attach (mi_on_exited, "mi-interp"); gdb::observers::no_history.attach (mi_on_no_history, "mi-interp"); diff --git a/gdb/observable.c b/gdb/observable.c index 49de89c25e0..82563e3fab4 100644 --- a/gdb/observable.c +++ b/gdb/observable.c @@ -34,7 +34,6 @@ bool observer_debug = false; DEFINE_OBSERVABLE (normal_stop); DEFINE_OBSERVABLE (signal_received); -DEFINE_OBSERVABLE (end_stepping_range); DEFINE_OBSERVABLE (signal_exited); DEFINE_OBSERVABLE (exited); DEFINE_OBSERVABLE (no_history); diff --git a/gdb/observable.h b/gdb/observable.h index 3066cf68f31..e4e6f021f1a 100644 --- a/gdb/observable.h +++ b/gdb/observable.h @@ -57,9 +57,6 @@ extern observable normal_stop; /* The inferior was stopped by a signal. */ extern observable signal_received; -/* We are done with a step/next/si/ni command. */ -extern observable<> end_stepping_range; - /* The inferior was terminated by a signal. */ extern observable signal_exited; -- 2.30.2