From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gateway23.websitewelcome.com (gateway23.websitewelcome.com [192.185.49.184]) by sourceware.org (Postfix) with ESMTPS id 95844383B408 for ; Sat, 29 May 2021 13:54:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 95844383B408 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=tom@tromey.com Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway23.websitewelcome.com (Postfix) with ESMTP id 22BB05B1C for ; Sat, 29 May 2021 08:54:46 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id mzQMlisU1FRe9mzQMlbz3y; Sat, 29 May 2021 08:54:46 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=4f1hA7G2+m1qb4hz/CaSrmtqg15L4ogJa5XFWpkoqAA=; b=KFFs37TvdBPaxqyqz+9KbZkESk QZVGeaibxRxkExEzl1Dp3Gi980WzYLove5D6G+f2nPgPiGy42Tkv+3RZnw5ZMncv8EWnJCCNo/x8J lIsAAlYpVYy+vjRh+dFraJNIU; Received: from 75-166-146-111.hlrn.qwest.net ([75.166.146.111]:52106 helo=localhost.localdomain) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1lmzQL-0042F2-UK; Sat, 29 May 2021 07:54:46 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 2/4] Minor cleanup to addrmap_index_data::previous_valid Date: Sat, 29 May 2021 07:54:41 -0600 Message-Id: <20210529135443.1446279-3-tom@tromey.com> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210529135443.1446279-1-tom@tromey.com> References: <20210529135443.1446279-1-tom@tromey.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 75.166.146.111 X-Source-L: No X-Exim-ID: 1lmzQL-0042F2-UK X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 75-166-146-111.hlrn.qwest.net (localhost.localdomain) [75.166.146.111]:52106 X-Source-Auth: tom+tromey.com X-Email-Count: 3 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-3032.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_NEUTRAL, 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: Sat, 29 May 2021 13:54:48 -0000 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). */ - 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