From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta034.useast.a.cloudfilter.net (omta034.useast.a.cloudfilter.net [44.202.169.33]) by sourceware.org (Postfix) with ESMTPS id F01233858425 for ; Wed, 17 Jan 2024 16:39:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F01233858425 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org F01233858425 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.33 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705509579; cv=none; b=ABP48WsmBsoY4J5D3061fG/a+aqw/63gZLAk5T2sWytj3v+J/GqTOBPGe/ORBG4xORpIlnO4LmomTCanGJ/X4KRFhlWoYWi9NZvyq3MnWqgmsjKhWkhLXLX3jPz9DzOH4CgP5Z/pLOsfdemBlBWXsy2vjVxh9fSes96IhAZ4lIw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705509579; c=relaxed/simple; bh=ZUpwl/JYTVjNohi7ePZe1JPlDbxZtsu1jQN6JBTYWaI=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=DmHC2ix/yUo3HI2blML+jd/LPU3SF2Y8HaXAyRNXUyHkgZHgD+tnjffu6BxhmOFoi5xPhOdavhlEyCItqzb0+TufVgXpSpEMmXa/BIOhiqnrHM5LNFOwz0g2tBfKnNL6XgSHEqoBbFZklwnWoPCMej0fniFkth0FYIDHPwh4pFs= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-5007a.ext.cloudfilter.net ([10.0.29.141]) by cmsmtp with ESMTPS id Q64ErymLMAxAkQ8xFrDaqs; Wed, 17 Jan 2024 16:39:53 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id Q8wyr8hAiPwzWQ8wzrQbJp; Wed, 17 Jan 2024 16:39:37 +0000 X-Authority-Analysis: v=2.4 cv=T8yf8tGQ c=1 sm=1 tr=0 ts=65a802c9 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=IkcTkHD0fZMA:10 a=dEuoMetlWLkA:10 a=Qbun_eYptAEA:10 a=oVUAMQxPL1YomZj9q5kA:9 a=QEXdDO2ut3YA:10 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:Sender:Reply-To:Cc: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=ClbSsgkuLMCbDSoVhHCIVtQCjX4Gdn0h1z045q2Q7FE=; b=u8O9mY+aN4a+T3JkOTmo/uBq7f X3kHR2WjsmfNrR9+sLnnTTNCHobf8NExf1e6WPWRRnwMWZeThQlpyxS3PDPzBQbwYXAzyqt80sO0W A5fMns0M40L+FDYEYFUbW3TB4; Received: from 97-122-68-157.hlrn.qwest.net ([97.122.68.157]:56636 helo=[192.168.0.21]) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1rQ8wy-002OXE-1d for gdb-patches@sourceware.org; Wed, 17 Jan 2024 09:39:36 -0700 From: Tom Tromey Date: Wed, 17 Jan 2024 09:39:31 -0700 Subject: [PATCH v2 03/17] Remove IS_ENUM_CLASS from cooked_index_flag MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240117-debug-names-fix-v2-3-dbd5971a9c31@tromey.com> References: <20240117-debug-names-fix-v2-0-dbd5971a9c31@tromey.com> In-Reply-To: <20240117-debug-names-fix-v2-0-dbd5971a9c31@tromey.com> To: gdb-patches@sourceware.org X-Mailer: b4 0.12.4 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: 97.122.68.157 X-Source-L: No X-Exim-ID: 1rQ8wy-002OXE-1d X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-68-157.hlrn.qwest.net ([192.168.0.21]) [97.122.68.157]:56636 X-Source-Auth: tom+tromey.com X-Email-Count: 7 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfNez7jEJkjTLuNgZYkPV0S/xFUjVo3qNQ98vEyPVaHiOn5FxQY44CtgRcw0l8wUlRXFN/F3p0Av0IG1QCaTbvZ8VOmEdT9+XFutSYIoW1Rqs6DxCG0EO DXlgzUD9yXO4BbftRdOqtgZlrAHDHjjTHsi7tiys3GLAg5RgSYiUy99+RXgpleJJ8Jix0/d+4VQbLWDbO5sxtkeuRGiO93GSPDo= X-Spam-Status: No, score=-3022.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,GIT_PATCH_0,JMQ_SPF_NEUTRAL,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: I noticed that cooked_index_flag::IS_ENUM_CLASS is not needed. This patch removes it. --- gdb/dwarf2/cooked-index.c | 1 - gdb/dwarf2/cooked-index.h | 8 +++----- gdb/dwarf2/read.c | 14 ++++++++------ 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/gdb/dwarf2/cooked-index.c b/gdb/dwarf2/cooked-index.c index e4f112b6ee0..f15ae9c28df 100644 --- a/gdb/dwarf2/cooked-index.c +++ b/gdb/dwarf2/cooked-index.c @@ -48,7 +48,6 @@ to_string (cooked_index_flag flags) static constexpr cooked_index_flag::string_mapping mapping[] = { MAP_ENUM_FLAG (IS_MAIN), MAP_ENUM_FLAG (IS_STATIC), - MAP_ENUM_FLAG (IS_ENUM_CLASS), MAP_ENUM_FLAG (IS_LINKAGE), MAP_ENUM_FLAG (IS_TYPE_DECLARATION), MAP_ENUM_FLAG (IS_PARENT_DEFERRED), diff --git a/gdb/dwarf2/cooked-index.h b/gdb/dwarf2/cooked-index.h index ebaed04753c..691a027704a 100644 --- a/gdb/dwarf2/cooked-index.h +++ b/gdb/dwarf2/cooked-index.h @@ -57,16 +57,14 @@ enum cooked_index_flag_enum : unsigned char IS_MAIN = 1, /* True if this entry represents a "static" object. */ IS_STATIC = 2, - /* True if this entry is an "enum class". */ - IS_ENUM_CLASS = 4, /* True if this entry uses the linkage name. */ - IS_LINKAGE = 8, + IS_LINKAGE = 4, /* True if this entry is just for the declaration of a type, not the definition. */ - IS_TYPE_DECLARATION = 16, + IS_TYPE_DECLARATION = 8, /* True is parent_entry.deferred has a value rather than parent_entry .resolved. */ - IS_PARENT_DEFERRED = 32, + IS_PARENT_DEFERRED = 16, }; DEF_ENUM_FLAGS_TYPE (enum cooked_index_flag_enum, cooked_index_flag); diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 84cbc1ac9af..cac194df617 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -4517,6 +4517,7 @@ class cooked_indexer sect_offset *sibling_offset, const cooked_index_entry **parent_entry, CORE_ADDR *maybe_defer, + bool *is_enum_class, bool for_specification); /* Handle DW_TAG_imported_unit, by scanning the DIE to find @@ -16162,6 +16163,7 @@ cooked_indexer::scan_attributes (dwarf2_per_cu_data *scanning_per_cu, sect_offset *sibling_offset, const cooked_index_entry **parent_entry, CORE_ADDR *maybe_defer, + bool *is_enum_class, bool for_specification) { bool origin_is_dwz = false; @@ -16245,7 +16247,7 @@ cooked_indexer::scan_attributes (dwarf2_per_cu_data *scanning_per_cu, case DW_AT_enum_class: if (attr.as_boolean ()) - *flags |= IS_ENUM_CLASS; + *is_enum_class = true; break; case DW_AT_low_pc: @@ -16355,7 +16357,8 @@ cooked_indexer::scan_attributes (dwarf2_per_cu_data *scanning_per_cu, else scan_attributes (scanning_per_cu, new_reader, new_info_ptr, new_info_ptr, new_abbrev, name, linkage_name, - flags, nullptr, parent_entry, maybe_defer, true); + flags, nullptr, parent_entry, maybe_defer, + is_enum_class, true); } } @@ -16507,6 +16510,7 @@ cooked_indexer::index_dies (cutu_reader *reader, cooked_index_flag flags = IS_STATIC; sect_offset sibling {}; const cooked_index_entry *this_parent_entry = parent_entry; + bool is_enum_class = false; /* The scope of a DW_TAG_entry_point cooked_index_entry is the one of its surrounding subroutine. */ @@ -16515,7 +16519,7 @@ cooked_indexer::index_dies (cutu_reader *reader, info_ptr = scan_attributes (reader->cu->per_cu, reader, info_ptr, info_ptr, abbrev, &name, &linkage_name, &flags, &sibling, &this_parent_entry, - &defer, false); + &defer, &is_enum_class, false); if (abbrev->tag == DW_TAG_namespace && m_language == language_cplus @@ -16585,9 +16589,7 @@ cooked_indexer::index_dies (cutu_reader *reader, "enum_class::enumerator"; otherwise we inject the names into our own parent scope. */ info_ptr = recurse (reader, info_ptr, - ((flags & IS_ENUM_CLASS) == 0) - ? parent_entry - : this_entry, + is_enum_class ? this_entry : parent_entry, fully); continue; -- 2.43.0