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 433FE38930D9 for ; Wed, 22 Jul 2020 12:22:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 433FE38930D9 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark@simark.ca Received: from [10.0.0.11] (173-246-6-90.qc.cable.ebox.net [173.246.6.90]) (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 99B491E794; Wed, 22 Jul 2020 08:22:48 -0400 (EDT) Subject: Re: [PATCH 6/9] Don't change current program space in exec_target::close To: Tom Tromey , gdb-patches@sourceware.org References: <20200722033444.18522-1-tom@tromey.com> <20200722033444.18522-7-tom@tromey.com> From: Simon Marchi Message-ID: <911cbbda-6f10-8806-7637-3be8111bd250@simark.ca> Date: Wed, 22 Jul 2020 08:22:45 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200722033444.18522-7-tom@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Language: fr Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-8.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, URIBL_CSS, URIBL_CSS_A autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2020 12:22:50 -0000 On 2020-07-21 11:34 p.m., Tom Tromey wrote: > Now that we've removed the macros and changed exec_close to be a > method, it's clear that exec_target::close can operate on program > spaces without changing the current program space. > > gdb/ChangeLog > 2020-07-21 Tom Tromey > > * exec.c (exec_target::close): Don't change current program > space. > --- > gdb/ChangeLog | 5 +++++ > gdb/exec.c | 3 --- > 2 files changed, 5 insertions(+), 3 deletions(-) > > diff --git a/gdb/exec.c b/gdb/exec.c > index e2a0cae787c..b2c7a58b27f 100644 > --- a/gdb/exec.c > +++ b/gdb/exec.c > @@ -154,11 +154,8 @@ exec_target_open (const char *args, int from_tty) > void > exec_target::close () > { > - scoped_restore_current_program_space restore_pspace; > - > for (struct program_space *ss : program_spaces) > { > - set_current_program_space (ss); > clear_section_table (&ss->target_sections); > ss->exec_close (); > } Ah, forget my comment on last patch. So yeah, ss->exec_close calls remove_target_sections, which uses current_program_space. I think that would need to be changed first, but there doesn't seem to be any blocker for that. Simon