From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id Abf7GsBYsGmE/SEAWB0awg (envelope-from ) for ; Tue, 10 Mar 2026 13:45:36 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=oct2025 header.b=NxK166LY; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 697691E0DD; Tue, 10 Mar 2026 13:45:36 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id C8FA01E089 for ; Tue, 10 Mar 2026 13:45:35 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 04D514B9DB7F for ; Tue, 10 Mar 2026 17:45:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 04D514B9DB7F Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=oct2025 header.b=NxK166LY Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id CCA124B9DB71 for ; Tue, 10 Mar 2026 17:45:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CCA124B9DB71 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=polymtl.ca Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=polymtl.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org CCA124B9DB71 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=132.207.4.11 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1773164710; cv=none; b=qtfl/JXCa+XrVS/oWP5AVE3zjImiIAD/6XpKhBIHE1LPAsgY56DY0EGqrkwkSWiACpMbo6OacmxfhKFSQjypQD35xyPJKqFEO5VsQpWlC5kYKoVm+2GB2nF/7TJHoAZ9v15Oc1u+MotZIBpSU+OxRvxDMPIneeknKQAkS1xvQR8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1773164710; c=relaxed/simple; bh=3x4ZgtdD4cg/mMnLJnTvfhZEbXYdTYPiGKPeERNfHV8=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Hgdcjv6jszydEsgd90G8+nduzDZwicaGMePzh3iTwKo44bWSZeG86TnfsjA8yGNuatr8BqWdUa0efD6N4cLjsTEaNA2u1Yr5qqJendJTUgUPEd8MtXqLCQwqXivpeFD+y4DeGI7TbX8/7zQGqXZ4b5EEDT9DWtmMFArR3XMOIzo= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CCA124B9DB71 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 62AHj3o8145215 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Mar 2026 13:45:08 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 62AHj3o8145215 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=oct2025; t=1773164708; bh=RrIxZGCJjMIZxMULacyUmkisMLE+IlVFLQ8EWKBhZ4g=; h=From:To:Cc:Subject:Date:From; b=NxK166LYx9EhXQ7QtHtwD2IaJZ8QcYy7Zorj0LnEbexr8/jWKS/rf0HVLCHmAj7yq moaRnEccQqs86xXXxQoEKGL4KJH3UC/1Eqsb5XQJKAz5dsiNicYpX/27H+vJxPNp// 1N8DFpJ26O0SsDYBB5Vca4n5+CsoOTexq5GDvI37fSLcbS76FelRLwXt3HOWxZuM70 VYYHq4sEF5WYSouWIt6QDhrh+y4L3Vg3/VJ4NfDzhFw71vdzuQJ4aREWE00S3rPBmj HfPqVcZqpknVysWUEmdQX99pw0yBi8Ed3VWa1HTgkLsLztQAnwD5Z4RrB/OTv4zQ03 LiKekYD9UMKqg== Received: by simark.ca (Postfix) id 0E41D1E089; Tue, 10 Mar 2026 13:45:02 -0400 (EDT) From: simon.marchi@polymtl.ca To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH] gdb/dwarf: implement section_and_offset comparison using operator== Date: Tue, 10 Mar 2026 13:44:57 -0400 Message-ID: <20260310174458.747011-1-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.53.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Tue, 10 Mar 2026 17:45:03 +0000 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org From: Simon Marchi This was suggested during review. Change-Id: Iabe893f5b7ee1c4dce9655cbc323e3640e061aa3 --- gdb/dwarf2/section.h | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/gdb/dwarf2/section.h b/gdb/dwarf2/section.h index 34a1810a387f..4711e53d1ad6 100644 --- a/gdb/dwarf2/section.h +++ b/gdb/dwarf2/section.h @@ -124,6 +124,10 @@ struct section_and_offset { const dwarf2_section_info *section; sect_offset offset; + + friend bool operator== (const section_and_offset &lhs, + const section_and_offset &rhs) noexcept + { return lhs.section == rhs.section && lhs.offset == rhs.offset; } }; /* Hash function for section_and_offset. */ @@ -141,18 +145,9 @@ struct section_and_offset_hash } }; -/* Equality function for section_and_offset. */ - -struct section_and_offset_eq -{ - bool operator() (const section_and_offset &a, - const section_and_offset &b) const noexcept - { return a.section == b.section && a.offset == b.offset; } -}; - template using unordered_section_and_offset_map = gdb::unordered_map; + section_and_offset_hash>; #endif /* GDB_DWARF2_SECTION_H */ base-commit: 34909f3a1dea81b0b83654c0de9375be20ac3d3b -- 2.53.0