From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 026833858D3C for ; Mon, 24 Apr 2023 19:55:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 026833858D3C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca Received: from [10.0.0.170] (unknown [167.248.160.41]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 5C29E1E0D3; Mon, 24 Apr 2023 15:55:09 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1682366109; bh=VGRf/ElkS7MHa+YlEk7YJojKjU1hS3zHDdIYRyqGGRM=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=p7n37/J02mFyYz/COOfLYlIvg0USq01Rld3X+gP44LdKLKxvD9ppw8J8oL6GK5z91 4QLObAfAwHtsbmbvTY+V3wWl0CyA/sFui7FDkTUcIKVQt4IV6WOUYlzbgIg99wdz14 xSZ5mRcmqnfF9hbeNV0Zuqgs7fl8xj6PZK2HghN4= Message-ID: Date: Mon, 24 Apr 2023 15:55:08 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH] gdb: remove end_stepping_range observable Content-Language: fr To: Tom Tromey , Simon Marchi via Gdb-patches Cc: Simon Marchi References: <20230424151007.54516-1-simon.marchi@efficios.com> <87zg6xxlj8.fsf@tromey.com> From: Simon Marchi In-Reply-To: <87zg6xxlj8.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 4/24/23 13:00, Tom Tromey wrote: >>>>>> "Simon" == Simon Marchi via Gdb-patches writes: > > Simon> I noticed that this observable was never notified, which means we can > Simon> probably safely remove it. > > I was curious so I dug in the history. It looks like the notification > as removed by: > > commit 243a925328f8e3184b2356bee497181049c0174f > Author: Pedro Alves > Date: Wed Sep 9 18:23:24 2015 +0100 > > Replace "struct continuation" mechanism by something more extensible > > > Anyway, that's long enough ago that I think this is fine. > > Simon> - print_end_stepping_range_reason (cli->interp_ui_out ()); > > I think nothing calls this now either. Ok, thanks. I updated the patch and pushed it, as below. Simon >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 99410147a6ce..5a515c603c6e 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 b79642e4d1e2..2f1c6cd694be 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 9b3c89629399..9513bc570e46 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 4f0bbd40f9d7..ce78b0c2b58a 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 49de89c25e04..82563e3fab47 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 3066cf68f314..e4e6f021f1a9 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.40.0