Message ID | 20230908190227.96319-12-simon.marchi@efficios.com |
---|---|
State | New |
Headers |
Return-Path: <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9FA413853D39 for <patchwork@sourceware.org>; Fri, 8 Sep 2023 19:05:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9FA413853D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1694199923; bh=QC/UV5tC/mjYMhLUdd9H5LFxUAY/BKCjfQ2CbzZU7rM=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=y2iQc9IuSxUfjz0s8UiaDPWtYMY2cb6lnmlv7jdSB3plPMT+s2XMCkP6p9KF5CUed 1APETo2XfiDXnuMy7kBybxqZoLbl+ATntuArAt5GsP5jlVhMP5HJlPHehy6b09ZWfg 684wyIYzTJ5tXXS9M2JnyR66GgXygkisr4VkD4UA= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 8F17C3858402 for <gdb-patches@sourceware.org>; Fri, 8 Sep 2023 19:04:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8F17C3858402 Received: from smarchi-efficios.internal.efficios.com (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 0E06D1E0D0; Fri, 8 Sep 2023 15:04:31 -0400 (EDT) To: gdb-patches@sourceware.org Cc: Simon Marchi <simon.marchi@efficios.com> Subject: [PATCH 11/21] gdb/cli: use m_ui instead of current_ui in cli_interp::resume Date: Fri, 8 Sep 2023 14:23:05 -0400 Message-ID: <20230908190227.96319-12-simon.marchi@efficios.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230908190227.96319-1-simon.marchi@efficios.com> References: <20230908190227.96319-1-simon.marchi@efficios.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3497.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_SOFTFAIL, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list <gdb-patches.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=subscribe> From: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> Reply-To: Simon Marchi <simon.marchi@efficios.com> Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
ui / interp cleansup
|
|
Commit Message
Simon Marchi
Sept. 8, 2023, 6:23 p.m. UTC
No behavior changes expected. Change-Id: I7fd944c99d249b3080d74d949186fe92795568eb --- gdb/cli/cli-interp.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
Comments
Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes: > No behavior changes expected. > > Change-Id: I7fd944c99d249b3080d74d949186fe92795568eb > --- > gdb/cli/cli-interp.c | 9 +++------ > 1 file changed, 3 insertions(+), 6 deletions(-) > > diff --git a/gdb/cli/cli-interp.c b/gdb/cli/cli-interp.c > index f0fa26919e76..8f1dbef56a6e 100644 > --- a/gdb/cli/cli-interp.c > +++ b/gdb/cli/cli-interp.c > @@ -190,25 +190,22 @@ cli_interp::init (bool top_level) > void > cli_interp::resume () > { > - struct ui *ui = current_ui; > - struct ui_file *stream; > - > /*sync_execution = 1; */ > > /* gdb_setup_readline will change gdb_stdout. If the CLI was > previously writing to gdb_stdout, then set it to the new > gdb_stdout afterwards. */ > > - stream = m_cli_uiout->set_stream (gdb_stdout); > + ui_file *stream = m_cli_uiout->set_stream (gdb_stdout); In the previous patch you changed an explicit reference to gdb_stdout to m_ui->stdout (). It's not clear why you haven't done that here, and in other places in this function. Thanks, Andrew > if (stream != gdb_stdout) > { > m_cli_uiout->set_stream (stream); > stream = NULL; > } > > - gdb_setup_readline (ui, 1); > + gdb_setup_readline (m_ui, 1); > > - ui->input_handler = command_line_handler; > + m_ui->input_handler = command_line_handler; > > if (stream != NULL) > m_cli_uiout->set_stream (gdb_stdout); > -- > 2.42.0
On 9/12/23 06:40, Andrew Burgess via Gdb-patches wrote: > Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes: > >> No behavior changes expected. >> >> Change-Id: I7fd944c99d249b3080d74d949186fe92795568eb >> --- >> gdb/cli/cli-interp.c | 9 +++------ >> 1 file changed, 3 insertions(+), 6 deletions(-) >> >> diff --git a/gdb/cli/cli-interp.c b/gdb/cli/cli-interp.c >> index f0fa26919e76..8f1dbef56a6e 100644 >> --- a/gdb/cli/cli-interp.c >> +++ b/gdb/cli/cli-interp.c >> @@ -190,25 +190,22 @@ cli_interp::init (bool top_level) >> void >> cli_interp::resume () >> { >> - struct ui *ui = current_ui; >> - struct ui_file *stream; >> - >> /*sync_execution = 1; */ >> >> /* gdb_setup_readline will change gdb_stdout. If the CLI was >> previously writing to gdb_stdout, then set it to the new >> gdb_stdout afterwards. */ >> >> - stream = m_cli_uiout->set_stream (gdb_stdout); >> + ui_file *stream = m_cli_uiout->set_stream (gdb_stdout); > > In the previous patch you changed an explicit reference to gdb_stdout to > m_ui->stdout (). It's not clear why you haven't done that here, and in > other places in this function. gdb_stdout uses current_ui under the hood, so I think I should change it here as well (as well as in the other patches, as you have noted). For v2, I will add a preparatory patch that adds all the necessary getters and setters in struct ui for stdout, stdin, etc, and I will go over these patches to uncover uses of current_ui hidden behind these macros. Simon
diff --git a/gdb/cli/cli-interp.c b/gdb/cli/cli-interp.c index f0fa26919e76..8f1dbef56a6e 100644 --- a/gdb/cli/cli-interp.c +++ b/gdb/cli/cli-interp.c @@ -190,25 +190,22 @@ cli_interp::init (bool top_level) void cli_interp::resume () { - struct ui *ui = current_ui; - struct ui_file *stream; - /*sync_execution = 1; */ /* gdb_setup_readline will change gdb_stdout. If the CLI was previously writing to gdb_stdout, then set it to the new gdb_stdout afterwards. */ - stream = m_cli_uiout->set_stream (gdb_stdout); + ui_file *stream = m_cli_uiout->set_stream (gdb_stdout); if (stream != gdb_stdout) { m_cli_uiout->set_stream (stream); stream = NULL; } - gdb_setup_readline (ui, 1); + gdb_setup_readline (m_ui, 1); - ui->input_handler = command_line_handler; + m_ui->input_handler = command_line_handler; if (stream != NULL) m_cli_uiout->set_stream (gdb_stdout);