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 0984C3861012 for ; Fri, 28 Aug 2020 16:34:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 0984C3861012 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 [172.16.0.95] (192-222-181-218.qc.cable.ebox.net [192.222.181.218]) (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 309671E554; Fri, 28 Aug 2020 12:34:11 -0400 (EDT) Subject: Re: [PATCH 01/13] Add a new overload of gdb_bfd_sections To: Tom Tromey , gdb-patches@sourceware.org References: <20200828162349.987-1-tom@tromey.com> <20200828162349.987-2-tom@tromey.com> From: Simon Marchi Message-ID: <7023e3ad-0200-9eaa-4a77-191b1cc5f567@simark.ca> Date: Fri, 28 Aug 2020 12:34:10 -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: <20200828162349.987-2-tom@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Language: tl Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_PASS, SPF_PASS, TXREP 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: Fri, 28 Aug 2020 16:34:14 -0000 On 2020-08-28 12:23 p.m., Tom Tromey wrote: > This adds a new overload of gdb_bfd_sections, that accepts a > gdb_bfd_ref_ptr. This also fixes the formatting of the existing > function, since I happened to notice it was mildly off. Ah thanks for fixing the formatting. I'm confusing different styles for different code bases I'm working with at the moment :). > > gdb/ChangeLog > 2020-08-28 Tom Tromey > > * gdb_bfd.h (gdb_bfd_sections): New overload. Fix formatting of > existing function. > --- > gdb/ChangeLog | 5 +++++ > gdb/gdb_bfd.h | 10 ++++++++-- > 2 files changed, 13 insertions(+), 2 deletions(-) > > diff --git a/gdb/gdb_bfd.h b/gdb/gdb_bfd.h > index 0f450567d50..12330970873 100644 > --- a/gdb/gdb_bfd.h > +++ b/gdb/gdb_bfd.h > @@ -205,10 +205,16 @@ bool gdb_bfd_get_full_section_contents (bfd *abfd, asection *section, > using gdb_bfd_section_iterator = next_iterator; > using gdb_bfd_section_range = next_adapter; > > -static inline > -gdb_bfd_section_range gdb_bfd_sections (bfd *abfd) > +static inline gdb_bfd_section_range > +gdb_bfd_sections (bfd *abfd) > { > return gdb_bfd_section_range (abfd->sections); > } > > +static inline gdb_bfd_section_range > +gdb_bfd_sections (const gdb_bfd_ref_ptr &abfd) > +{ > + return gdb_bfd_section_range (abfd->sections); > +}; > + Just to confirm, the point of this is to avoid having to do `.get ()` everywhere? (it LGTM) Simon