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 628403857C6A for ; Wed, 22 Jul 2020 12:21:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 628403857C6A 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) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 87D321E794; Wed, 22 Jul 2020 08:21:01 -0400 (EDT) Subject: Re: [PATCH 5/9] Remove current_target_sections macro To: Tom Tromey , gdb-patches@sourceware.org References: <20200722033444.18522-1-tom@tromey.com> <20200722033444.18522-6-tom@tromey.com> From: Simon Marchi Message-ID: <0cb15409-d939-34e8-79e3-8dce80c5e0f2@simark.ca> Date: Wed, 22 Jul 2020 08:20:58 -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-6-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:21:04 -0000 On 2020-07-21 11:34 p.m., Tom Tromey wrote: > This removes the current_target_sections macro, replacing it with uses > of the appropriate member from current_program_space. > > gdb/ChangeLog > 2020-07-21 Tom Tromey > > * progspace.h (current_target_sections): Remove macro. > * solib-svr4.c (scan_dyntag): Update. > * solib-dsbt.c (scan_dyntag): Update. > * exec.c (exec_target::close): Update. > (add_target_sections, add_target_sections_of_objfile) > (remove_target_sections, exec_target::get_section_table) > (exec_target::files_info, set_section_command) > (exec_set_section_address, exec_target::has_memory) > (exec_target::has_memory): Update. > --- > gdb/ChangeLog | 12 ++++++++++++ > gdb/exec.c | 23 +++++++++++++---------- > gdb/progspace.h | 4 ---- > gdb/solib-dsbt.c | 6 +++--- > gdb/solib-svr4.c | 6 +++--- > 5 files changed, 31 insertions(+), 20 deletions(-) > > diff --git a/gdb/exec.c b/gdb/exec.c > index 6ca867ab53e..e2a0cae787c 100644 > --- a/gdb/exec.c > +++ b/gdb/exec.c > @@ -159,7 +159,7 @@ exec_target::close () > for (struct program_space *ss : program_spaces) > { > set_current_program_space (ss); > - clear_section_table (current_target_sections); > + clear_section_table (&ss->target_sections); > ss->exec_close (); I hoped that the call to set_current_program_space could be removed, but no. exec_close ends up calling remove_target_sections, which uses current_program_space. But once we make remove_target_sections take a program_space parameter, I think it will be fine to remove it. Simon