From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 2KoiCPM2xmD0IgAAWB0awg (envelope-from ) for ; Sun, 13 Jun 2021 12:48:51 -0400 Received: by simark.ca (Postfix, from userid 112) id 120771F163; Sun, 13 Jun 2021 12:48:51 -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.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED 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 C13821E01F for ; Sun, 13 Jun 2021 12:48:49 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C4D98383803E for ; Sun, 13 Jun 2021 16:48:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C4D98383803E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623602928; bh=EWN0d2ZQbAV7t55DN02h1jPLGDeLO+AiW9YUcWmPda8=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=qiEw5DEOphiGbKovCDjHudgQxKrWJbnjOj+fZuAarsSyObSzHvfwQ2qHYhmRxYMKc 6328t58HFx4/SDE9SipiAdwP+NL7wHAeQ7CHOtOtLGlhV9RLPxpOLG/pCJqa3Ji+U0 KwHNUPU2XLDkAreNkYjAX9CjgQ3BOvQUwumXEyJw= Received: from lndn.lancelotsix.com (lndn.lancelotsix.com [51.195.220.111]) by sourceware.org (Postfix) with ESMTPS id 09BB8385782D for ; Sun, 13 Jun 2021 16:48:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 09BB8385782D Received: from Plymouth (unknown [IPv6:2a02:390:9086:0:2ad1:2c48:6532:8f3f]) by lndn.lancelotsix.com (Postfix) with ESMTPSA id C641F81895; Sun, 13 Jun 2021 16:48:26 +0000 (UTC) Date: Sun, 13 Jun 2021 17:48:22 +0100 To: Tom Tromey Subject: Re: [PATCH 2/4] Minor cleanup to addrmap_index_data::previous_valid Message-ID: <20210613164822.i3guvbgw5n5smie7@Plymouth> References: <20210529135443.1446279-1-tom@tromey.com> <20210529135443.1446279-3-tom@tromey.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210529135443.1446279-3-tom@tromey.com> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.11 (lndn.lancelotsix.com [0.0.0.0]); Sun, 13 Jun 2021 16:48:27 +0000 (UTC) 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: , From: Lancelot SIX via Gdb-patches Reply-To: Lancelot SIX Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Hi On Sat, May 29, 2021 at 07:54:41AM -0600, Tom Tromey wrote: > This changes addrmap_index_data::previous_valid to a bool, and > initializes it inline. > > 2021-05-28 Tom Tromey > > * dwarf2/index-write.c (struct addrmap_index_data) > : Now bool. Initialize. > (add_address_entry_worker): Update. > (write_address_map): Update. > --- > gdb/ChangeLog | 7 +++++++ > gdb/dwarf2/index-write.c | 12 +++--------- > 2 files changed, 10 insertions(+), 9 deletions(-) > > diff --git a/gdb/dwarf2/index-write.c b/gdb/dwarf2/index-write.c > index ffc49e8ba82..656742f2e0a 100644 > --- a/gdb/dwarf2/index-write.c > +++ b/gdb/dwarf2/index-write.c > @@ -422,7 +422,7 @@ struct addrmap_index_data > /* Non-zero if the previous_* fields are valid. > We can't write an entry until we see the next entry (since it is only then > that we know the end of the entry). */ The comment could also change from “Non-zero” to “true” to reflect the type change, or even “Indicates if the previous_* fields are valid”. Lancelot. > - int previous_valid; > + bool previous_valid = false; > /* Index of the CU in the table of all CUs in the index file. */ > unsigned int previous_cu_index; > /* Start address of the CU. */ > @@ -459,10 +459,10 @@ add_address_entry_worker (void *datap, CORE_ADDR start_addr, void *obj) > const auto it = data->cu_index_htab.find (pst); > gdb_assert (it != data->cu_index_htab.cend ()); > data->previous_cu_index = it->second; > - data->previous_valid = 1; > + data->previous_valid = true; > } > else > - data->previous_valid = 0; > + data->previous_valid = false; > > return 0; > } > @@ -477,12 +477,6 @@ write_address_map (dwarf2_per_bfd *per_bfd, data_buf &addr_vec, > { > struct addrmap_index_data addrmap_index_data (addr_vec, cu_index_htab); > > - /* When writing the address table, we have to cope with the fact that > - the addrmap iterator only provides the start of a region; we have to > - wait until the next invocation to get the start of the next region. */ > - > - addrmap_index_data.previous_valid = 0; > - > addrmap_foreach (per_bfd->partial_symtabs->psymtabs_addrmap, > add_address_entry_worker, &addrmap_index_data); > > -- > 2.26.3 >