From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id gDy/G+FXj18ffgAAWB0awg (envelope-from ) for ; Tue, 20 Oct 2020 17:34:25 -0400 Received: by simark.ca (Postfix, from userid 112) id 656291EFC5; Tue, 20 Oct 2020 17:34:25 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id CFF341EFC1 for ; Tue, 20 Oct 2020 17:34:24 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7E3C53857807; Tue, 20 Oct 2020 21:34:24 +0000 (GMT) Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 2ED2C3857807 for ; Tue, 20 Oct 2020 21:34:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2ED2C3857807 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 D21DD1EFBF; Tue, 20 Oct 2020 17:34:22 -0400 (EDT) Subject: Re: [PATCH v2 07/16] Remove the exec_bfd macro To: Tom Tromey References: <20201019214429.13815-1-tom@tromey.com> <20201019214429.13815-8-tom@tromey.com> <8c4c1ec0-cdc9-ebc9-26fa-216f59493d9b@simark.ca> <87mu0gd26t.fsf@tromey.com> From: Simon Marchi Message-ID: Date: Tue, 20 Oct 2020 17:34:22 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <87mu0gd26t.fsf@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Language: fr Content-Transfer-Encoding: 7bit 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: , Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 2020-10-20 5:20 p.m., Tom Tromey wrote: > Simon> Maybe just check for lines that are too long after the replacement. > > Will do. > >>> - add_target_sections (&exec_bfd, sections); >>> + add_target_sections (¤t_program_space->ebfd, sections); > > Simon> It's odd that the owner of these sections is the address of the ebfd > Simon> field in the program_space structure, and not the bfd pointer itself. > Simon> Do you know if this is done on purpose? > > There's probably no good reason for it, though I'm not completely sure. > > Simon> I don't see anything that could change the value of exec bfd in the mean > Simon> time, that would make the "owner" value of these sections stale. So I > Simon> believe it would be safe to use `current_program_space->exec_bfd ()` as > Simon> the owner. > > Or even just the program space itself. > The value is really just a cookie to make sure that different callers > don't accidentally clash. True, but I think it would be more confusing, since the target sections are derived from the exec bfd. Simon