From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id jsGJArcz6mpLMAwAWB0awg (envelope-from ) for ; Tue, 03 Nov 2026 14:19:19 -0500 Authentication-Results: simark.ca; dkim=pass (2048-bit key; secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=PBYRm4yR; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id E9AF51E043; Tue, 03 Nov 2026 14:19:18 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.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 autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::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 8C2B81E043 for ; Tue, 03 Nov 2026 14:19:17 -0500 (EST) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D3AC44BAE7D3 for ; Tue, 3 Nov 2026 19:19:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D3AC44BAE7D3 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=PBYRm4yR Received: from mail-ot1-x32b.google.com (mail-ot1-x32b.google.com [IPv6:2607:f8b0:4864:20::32b]) by sourceware.org (Postfix) with ESMTPS id BDE9B4BA2E15 for ; Tue, 3 Nov 2026 19:18:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BDE9B4BA2E15 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BDE9B4BA2E15 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::32b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1793733531; cv=none; b=BWc92biISfaiw/kwUdg6vawVWyjFy1T5FdFAIBeU3nbEhAJEi26BKDqkqmMpAXdJpOzzPugYpshwy29G5XGu3Ogb8L63Iw46e5b2M9wBhTdy4ORHU9PLo7All1M3ekAddrYEv6Uw1xeJoELAJvOJyJLcIXTWYrKjUEuBPGhRCrI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1793733531; c=relaxed/simple; bh=mdG421JTa0zAHaVDMf/OIFpi3mAxjE0Q3mW7L8Qg1YU=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=fucKM+DQhL5S48vCoBS3hmMFjBWCfq7ubEgXhthaL+8ECGqVYLJWvgi21Pmw4FgvElkiILQE7x0t9oZEnqla2EESpkFN9OGUfwL3Xx8CVULaldoAXkgAdzfBCWO8iaom9zMNI0N+4pRkyFjk6x9hPjr0+wSUKIP98CTko+f2tbU= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=PBYRm4yR DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BDE9B4BA2E15 Received: by mail-ot1-x32b.google.com with SMTP id 46e09a7af769-8439fe796ebso3109913a34.3 for ; Tue, 03 Nov 2026 11:18:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1793733531; x=1794338331; darn=sourceware.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Mpf3L3s3ypQgWjeNdr8+gepZqCrs5Y2RJLW0fSHr+nM=; b=PBYRm4yRR3ycN/xiUskl5gTWPfFnYw+b8RL0aV/G0cXFiU+E5gptScOnTZ4wD2ymqL 7v/lEPqkJeiKj1o3Gne3SEHaJw+5Ek0q8TBcMX/WZnXTgb/MdmlUMtrlruU4nXCCi2EW z23g0W7f41f2U61NE2tPOO+Bc7GgJ8+kaq+rgIk6/486TYaI5hJ3m5RSJSt6JuwT5cZD WLQI1QcBb7dPdm/sGHP/K/U+DdseUhgAVcmwg+CcoxLrL0bah9qplf2749rVofXUUFux ECbKwzvPTa7HVwkYlEeOGjvWW7SnlE0m09yvDvIECDXjly7lizBkWxIwDvFDoBGPazkQ VZIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793733531; x=1794338331; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=Mpf3L3s3ypQgWjeNdr8+gepZqCrs5Y2RJLW0fSHr+nM=; b=xM2wv+TDZzLzibvChAb+STKMqjQQCRt5qYYIul7DDLm2WXp3XKsYyUmmk9145lv8Rr pM5VXOqWUOvj4PwSoUCFpbsjXNw0HcmNccQrtBmyYvJD/4zwimXlprTPZtcjwXKL3IHB mTXthnC6lMFSI0M/vbrR2JM4VHw8P4WM+NpNoIxe0BhvtunJ1CQnagD3/LgzuNOa3z4X lUF5DRmbN00kMVMWol9HcX2LA7eZQP8ZyYwGAgup95het8kVvvwOKN2/d6aYxG4n97As 6rnraZ836XAU1b/Hp5ETt4mtH/Yokp+UXTD7s97XM4uPT9tNoGaWqHxHx8/VRLKortoL 9SXg== X-Gm-Message-State: APuU4Z+cm/ttlM9C38vcZZyDHYTftKDSCphq9tYQUVhdYePclT6IQsUx qZFdNO6vB6IzR5ApOi5EvOfWiZ2riBynPSScoultrTk5clLOTH96pF38uxQoJlQiWLkarJ6ZPPV wxZFHAQ== X-Gm-Gg: AYBFou0o7naOLAaXQi5Tkaf4+r+xfqYx9FC3uI+5jjxER9OKFViYX0KpDfKRinumrz2 Tv7GkK26UAteOmvuD8feZOnqulL8coHahl4oMz2UsmCz1JvMrvdr/kTrXXaAD0BKxn+sSafLt+F 3+h+9OfD7bM2cB6gwLSfmoNyNYPx9Bqci859oKyRoO06rbw/V7TPvjjyMKqWOYvsZSyQEqmuW2E 09wmATXXmx9/j8xobs/3VUVv1WChxrBc0hNBxgA2SbtU/WEpdtIG/1oVS4rZrEG7b+Wxg6DyJoe UoQqxy7QDeEvwuy3aDLOfYwHgbrk6w389UyBYP9aFh1ARTN6xosCmCsV0il1hZBHxTSUF1JqdVx MyPM3gRFa3IyJ3j1ngDNv6wERqMxXsMba08CCtiVJoho5FkdTsn8ityZFGZD+E7iEyMlvZ88h0u HH3vwD0tx16jrtLJbRv6BeqetvuPPxzEjdZ3+QSzOt2ahroT+cTFI5NJB36gQGqeuZe6dHElGze hOl1Zi7ajOPynYwxYg3mOrbtwChDxqAAlhMsXSxqdVZ5ejJ2VsYtkyjcJjC6tDfal727L/Lg5+Z ZfTANvuyb/GoUO5dav451JckjGMlCkKbhbTCkZI8y7hRq/We3XvuL0eLNfvbTko= X-Received: by 2002:a05:6808:1a1f:b0:4f5:eaac:517a with SMTP id 5614622812f47-5640d9293a1mr9960690b6e.1.1793733530992; Tue, 03 Nov 2026 11:18:50 -0800 (PST) Received: from [192.168.0.26] (97-122-110-129.hlrn.qwest.net. [97.122.110.129]) by smtp.gmail.com with ESMTPSA id 5614622812f47-5640fe0d46dsm11701744b6e.11.2026.11.03.11.18.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Nov 2026 11:18:50 -0800 (PST) From: Tom Tromey Date: Tue, 03 Nov 2026 12:18:43 -0700 Subject: [PATCH 4/4] Remove operator== and operator!= from gdb::span MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20261103-span-part-1-v1-4-133180dd43a5@adacore.com> References: <20261103-span-part-1-v1-0-133180dd43a5@adacore.com> In-Reply-To: <20261103-span-part-1-v1-0-133180dd43a5@adacore.com> To: gdb-patches@sourceware.org Cc: Tom Tromey X-Mailer: b4 0.15.2 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 gdb::span currently provides operator== and operator!=. However, these aren't part of the C++20 std::span. There, instead, one must use std::ranges::equal for deep equality. This patch changes gdb::span to be similar, introducing gdb::ranges::equal. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31422 --- gdb/dwarf2/read-debug-names.c | 9 ++++++--- gdb/value.c | 2 +- gdbsupport/span.h | 14 +++++--------- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/gdb/dwarf2/read-debug-names.c b/gdb/dwarf2/read-debug-names.c index a1e9d8c12ee..ca3b46fc9b1 100644 --- a/gdb/dwarf2/read-debug-names.c +++ b/gdb/dwarf2/read-debug-names.c @@ -817,17 +817,20 @@ read_debug_names_from_section (dwarf2_per_objfile *per_objfile, aug_repr.c_str ()); } - if (augmentation_string == gdb::make_span (dwarf5_augmentation_1)) + if (gdb::ranges::equal (augmentation_string, + gdb::make_span (dwarf5_augmentation_1))) { warning (_(".debug_names created by an old version of gdb; ignoring")); return false; } - else if (augmentation_string == gdb::make_span (dwarf5_augmentation_2)) + else if (gdb::ranges::equal (augmentation_string, + gdb::make_span (dwarf5_augmentation_2))) { map.augmentation_is_gdb = true; map.gdb_augmentation_version = 2; } - else if (augmentation_string == gdb::make_span (dwarf5_augmentation_3)) + else if (gdb::ranges::equal (augmentation_string, + gdb::make_span (dwarf5_augmentation_3))) { map.augmentation_is_gdb = true; map.gdb_augmentation_version = 3; diff --git a/gdb/value.c b/gdb/value.c index 36e81eb9139..f0e1905b9a7 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -4387,7 +4387,7 @@ static bool check_ranges_vector (gdb::span ranges, gdb::span expected) { - return ranges == expected; + return gdb::ranges::equal (ranges, expected); } /* Test the insert_into_bit_range_vector function. */ diff --git a/gdbsupport/span.h b/gdbsupport/span.h index 01429bcc666..360ff766182 100644 --- a/gdbsupport/span.h +++ b/gdbsupport/span.h @@ -229,9 +229,12 @@ void copy (gdb::span src, gdb::span dest) RHS have the same sizes, and whether each pair of elements of LHS and RHS at the same position compares equal. */ +namespace ranges +{ + template bool -operator== (const gdb::span &lhs, const gdb::span &rhs) +equal (const gdb::span &lhs, const gdb::span &rhs) { if (lhs.size () != rhs.size ()) return false; @@ -243,14 +246,7 @@ operator== (const gdb::span &lhs, const gdb::span &rhs) return true; } -/* Compare two spans for inequality. */ - -template -bool -operator!= (const gdb::span &lhs, const gdb::span &rhs) -{ - return !(lhs == rhs); -} +} /* namespace ranges */ /* Create a span from a pointer to an array and an element count. -- 2.56.0