From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id B5AD63858C50 for ; Tue, 12 Sep 2023 16:37:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B5AD63858C50 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=polymtl.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=polymtl.ca Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 38CGaqWn015778 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 Sep 2023 12:36:56 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 38CGaqWn015778 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1694536617; bh=VY8BvLJyH5HC1wVyWVrhxbKLKWeYiOZyMPTV4yQc6ew=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=U5SqQGt/c/bG/d/so0qXAsPaanizoLlleGh4ktVQoM1Cr6KJqpLyeOfJpiTBTp3tf NYUejg9uX8di8bAB+ie2Cz5prnYJ9yk9GREbZ6kHbstOww4+wNAo6r3GUKCmVdfQ1Y QUsFhdCkOGNiHnbolyDC5NKtD4BM2jdWtH5bhEnk= Received: from [172.16.0.192] (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id D3B8B1E092; Tue, 12 Sep 2023 12:36:51 -0400 (EDT) Message-ID: <5d20845b-0c58-45f5-9e81-6643ae54b19f@polymtl.ca> Date: Tue, 12 Sep 2023 12:36:51 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 13/21] gdb/mi: use m_ui instead of current_ui in mi_interp::resume Content-Language: fr To: Andrew Burgess , Simon Marchi via Gdb-patches Cc: Simon Marchi References: <20230908190227.96319-1-simon.marchi@efficios.com> <20230908190227.96319-14-simon.marchi@efficios.com> <87cyynk6w8.fsf@redhat.com> From: Simon Marchi In-Reply-To: <87cyynk6w8.fsf@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Tue, 12 Sep 2023 16:36:52 +0000 X-Spam-Status: No, score=-3037.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS,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 List-Id: On 9/12/23 06:44, Andrew Burgess via Gdb-patches wrote: > Simon Marchi via Gdb-patches writes: > >> No behavior changes expected. >> >> Change-Id: Ic379a18d6a6d83a55cd4a6d1239d4daa98966cc8 >> --- >> gdb/mi/mi-interp.c | 7 +++---- >> 1 file changed, 3 insertions(+), 4 deletions(-) >> >> diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c >> index f260d98837cf..b676e22f3550 100644 >> --- a/gdb/mi/mi-interp.c >> +++ b/gdb/mi/mi-interp.c >> @@ -118,14 +118,13 @@ void >> mi_interp::resume () >> { >> struct mi_interp *mi = this; >> - struct ui *ui = current_ui; >> >> /* As per hack note in mi_interpreter_init, swap in the output >> channels... */ >> - gdb_setup_readline (ui, 0); >> + gdb_setup_readline (m_ui, 0); >> >> - ui->call_readline = gdb_readline_no_editing_callback; >> - ui->input_handler = mi_execute_command_input_handler; >> + m_ui->call_readline = gdb_readline_no_editing_callback; >> + m_ui->input_handler = mi_execute_command_input_handler; >> >> gdb_stdout = mi->out; > > Same stdout question as for the previous two patches. > > I'm wondering if we're going to have to live in some halfway house for a > while, in which case maybe we should be adding an assert like: > > gdb_assert (current_ui == m_ui); > > Or maybe I've jut not understood something here (or maybe a later patch > fixes all this suff, and I'm just making noise). If I change those uses of gdb_stdout and friends, I think these methods (init, resume, suspend) are pretty-much independent of global state. Simon