From patchwork Wed Feb 26 01:08:08 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 107094 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A10663858CDA for ; Wed, 26 Feb 2025 01:10:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A10663858CDA Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=hR34PbHt X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from omta36.uswest2.a.cloudfilter.net (omta36.uswest2.a.cloudfilter.net [35.89.44.35]) by sourceware.org (Postfix) with ESMTPS id D9D793858D28 for ; Wed, 26 Feb 2025 01:08:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D9D793858D28 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 D9D793858D28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.35 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1740532095; cv=none; b=tLiDJSEjVZalAESsqnzVsDHH+mzW3mjStBcPDbRf8FgVa59DLM84bbe8uTA+gKmm2b/rUg2KsDt9w9XpdjY91YmVdUYj/PJF3bF0eyL8YlLTlWzGMFqpgEDxBzNaM4Dn+r5Ijliu9xqPVviBYB68Q1LRoC3XCCz8gCu3pownO8k= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1740532095; c=relaxed/simple; bh=GwwILeW4Fpa6PnoWgmR7OhVS6BluF9SG3/bUg9xwzUw=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=Dw5KTErBBq/Z4rCy/fnwO14HWfacie1hGB8aMWtRBPAdbdwYtaaxPyiA5SwAT05LW4hPZF3ZlkJj6pZQ0bQK3AiN6RqtwfKkTAPKSDAkQ6QJfxevsAjywM+XeOmnFKbNHu3icw/cy9CtLlncwbViiBLb5cjEWUEJRInjR3yxg08= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D9D793858D28 Received: from eig-obgw-6004a.ext.cloudfilter.net ([10.0.30.197]) by cmsmtp with ESMTPS id mbIPtZpw9METln5uHtyJwc; Wed, 26 Feb 2025 01:08:13 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id n5uHty64hlqdtn5uHttFMN; Wed, 26 Feb 2025 01:08:13 +0000 X-Authority-Analysis: v=2.4 cv=JIzwsNKb c=1 sm=1 tr=0 ts=67be697d a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=IkcTkHD0fZMA:10 a=T2h4t0Lz3GQA:10 a=ItBw4LHWJt0A:10 a=RqJ-gwY_cWn2enh-FysA:9 a=QEXdDO2ut3YA:10 a=6Ogn3jAGHLSNbaov7Orx:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Cc:To:In-Reply-To:References:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From:Sender: Reply-To: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=ErKQPsLO1B4MMy1TX0VEPc9XOw4FP7uC1iXQbwNJTos=; b=hR34PbHtdCSUzyfInBBOj5GE6z PPlnJ4ZVt79q8eBHblLMKuypgtgMLn0h8OXp03pAu5vzPGGrn7nOFqlnHyx6hRr8FG7qiGqVAXY6a MZPbgHsEI+hgV2aXQUYjFT32k; Received: from 97-118-36-154.hlrn.qwest.net ([97.118.36.154]:33482 helo=prentzel.local) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.1) (envelope-from ) id 1tn5uG-00000001I51-3CFS; Tue, 25 Feb 2025 18:08:12 -0700 From: Tom Tromey Date: Tue, 25 Feb 2025 18:08:08 -0700 Subject: [PATCH 01/10] Use gdb set and map in source_cache MIME-Version: 1.0 Message-Id: <20250225-source-cache-hash-v1-1-f937ce22b0e9@tromey.com> References: <20250225-source-cache-hash-v1-0-f937ce22b0e9@tromey.com> In-Reply-To: <20250225-source-cache-hash-v1-0-f937ce22b0e9@tromey.com> To: gdb-patches@sourceware.org Cc: Tom Tromey X-Mailer: b4 0.14.2 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.118.36.154 X-Source-L: No X-Exim-ID: 1tn5uG-00000001I51-3CFS X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-118-36-154.hlrn.qwest.net (prentzel.local) [97.118.36.154]:33482 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfD6t1XQ1RODWU27DQmFJbQ86nWI6PVAQT5VdrDEWXoZU4PfM72XmvSPuEpByhXYcpXnchB4OM+Uew09JfbhW3ElQZ15fPm3RSngHtSeu/fMHs7Icmh7L 2a/kP0nQr6uJGufOFn1uMgk/QGrQO2+ZvldLVMFRqMLt9IpF2MRev6QvetP0u1NWdHbRTJiDf6KGXQE3Cv/JUgiyMddq67BNFYg= X-Spam-Status: No, score=-3018.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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~patchwork=sourceware.org@sourceware.org This changes source_cache to use gdb::unordered_map and gdb::unordered_set rather than the std:: variants. --- gdb/source-cache.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gdb/source-cache.h b/gdb/source-cache.h index 35eeb1cb204710d375469b3e4e7b483cefce355c..03f4b79778f9a5b1117681d2cfd659296d561370 100644 --- a/gdb/source-cache.h +++ b/gdb/source-cache.h @@ -19,8 +19,8 @@ #ifndef GDB_SOURCE_CACHE_H #define GDB_SOURCE_CACHE_H -#include -#include +#include "gdbsupport/unordered_map.h" +#include "gdbsupport/unordered_set.h" /* This caches two things related to source files. @@ -95,10 +95,10 @@ class source_cache /* The file offset cache. The key is the full name of the source file. */ - std::unordered_map> m_offset_cache; + gdb::unordered_map> m_offset_cache; /* The list of files where styling failed. */ - std::unordered_set m_no_styling_files; + gdb::unordered_set m_no_styling_files; }; /* The global source cache. */ From patchwork Wed Feb 26 01:08:09 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 107100 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 69E2C3858D35 for ; Wed, 26 Feb 2025 01:15:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 69E2C3858D35 Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=nnSvtJnX X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from omta40.uswest2.a.cloudfilter.net (omta40.uswest2.a.cloudfilter.net [35.89.44.39]) by sourceware.org (Postfix) with ESMTPS id 79FB63858D29 for ; Wed, 26 Feb 2025 01:08:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 79FB63858D29 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 79FB63858D29 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.39 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1740532095; cv=none; b=BE9cxncrnoOCVocWkeTPSNyAjtHaV+zFBX6AQ0k0gx9GdDYbt+xT8F4jvPEuCH1LytHWNlTkcmwK6BvtSZaYVTcvYhmFgLHb5A7fMIz2yZwxLwAnN3T+iVr95SKuP9o4wUEXbihX5zJA5JsUj80Kl9h1ILzs0Ip1uYIvtlgJeHA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1740532095; c=relaxed/simple; bh=pOiDY+GhC/1r2dmhofSbj/eapJ/ESYz6VXxp1MA5Q60=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=gG9+SLC/Zv5toLRChdd0JPCWB0SIAzimbSyzsOFObQE+tEOhjxtPUrChcv2pz6YL5zsQDrgO020x435jSa2Q0moyuSkfhYYQ04msZNzelpnG/u3W7AsWrOIyx4Uco4+b8HwEqUP4vkZmqL1nrQrf3tl5pmjqE1HxfUh5Tevf38U= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 79FB63858D29 Received: from eig-obgw-5004a.ext.cloudfilter.net ([10.0.29.221]) by cmsmtp with ESMTPS id mblDtPHRyf1UXn5uItNSRl; Wed, 26 Feb 2025 01:08:14 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id n5uHtKIXQb7c4n5uHtTGyu; Wed, 26 Feb 2025 01:08:14 +0000 X-Authority-Analysis: v=2.4 cv=KvSG2nWN c=1 sm=1 tr=0 ts=67be697e a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=IkcTkHD0fZMA:10 a=T2h4t0Lz3GQA:10 a=ItBw4LHWJt0A:10 a=0rceHk33MezB69DthYYA:9 a=QEXdDO2ut3YA:10 a=6Ogn3jAGHLSNbaov7Orx:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Cc:To:In-Reply-To:References:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From:Sender: Reply-To: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=J5bmq9vH2w/cszg6OvY3MX1HSaVLD428eSvahfSYEiY=; b=nnSvtJnXlrIvNWCv5a5YXaFYqG Cw83sy0lygU89I9faERLnTrsnfpPOpb/Tu9klKf6w5+nSOYGlVZxU/ErWKK1vWVNoiLK7PLw/O6J3 +IGUodT9NXTTwmvFozSusuSgG; Received: from 97-118-36-154.hlrn.qwest.net ([97.118.36.154]:33482 helo=prentzel.local) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.1) (envelope-from ) id 1tn5uH-00000001I51-0jKE; Tue, 25 Feb 2025 18:08:13 -0700 From: Tom Tromey Date: Tue, 25 Feb 2025 18:08:09 -0700 Subject: [PATCH 02/10] Use gdb set and map in TUI MIME-Version: 1.0 Message-Id: <20250225-source-cache-hash-v1-2-f937ce22b0e9@tromey.com> References: <20250225-source-cache-hash-v1-0-f937ce22b0e9@tromey.com> In-Reply-To: <20250225-source-cache-hash-v1-0-f937ce22b0e9@tromey.com> To: gdb-patches@sourceware.org Cc: Tom Tromey X-Mailer: b4 0.14.2 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.118.36.154 X-Source-L: No X-Exim-ID: 1tn5uH-00000001I51-0jKE X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-118-36-154.hlrn.qwest.net (prentzel.local) [97.118.36.154]:33482 X-Source-Auth: tom+tromey.com X-Email-Count: 3 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfKcrcNZRtHHB3ShmM+PxzKrD2adHxTz4pyCqEaqdxp96H7+u/Vessq121/8t+gR2+gEhItFAdMrwzy+JobOr4MG/SG3EwiMZSX7YkQ8YcgOTTamPvBK2 OulUgebRT/5IH14GtEKzkOYWEuWU6EInswFQ6kx6fXwAEu6Kbi7vY5MsJrA7OGmHpJUwWAPpExq4xWQcT4W559Ys1wPI3HrYh18= X-Spam-Status: No, score=-3018.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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~patchwork=sourceware.org@sourceware.org This changes the TUI to use gdb::unordered_map and gdb::unordered_set rather than the std:: variants. --- gdb/tui/tui-layout.c | 4 ++-- gdb/tui/tui-layout.h | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c index 79b7289c2a61fe93c5c1aa8cc375ff3bc9129fc1..3fac65f356e1ed35c40542df28f790afaae145e6 100644 --- a/gdb/tui/tui-layout.c +++ b/gdb/tui/tui-layout.c @@ -24,7 +24,7 @@ #include "frame.h" #include "cli/cli-decode.h" #include "cli/cli-utils.h" -#include +#include "gdbsupport/unordered_set.h" #include "tui/tui.h" #include "tui/tui-command.h" @@ -1221,7 +1221,7 @@ tui_new_layout_command (const char *spec, int from_tty) std::vector> splits; splits.emplace_back (new tui_layout_split (is_vertical)); - std::unordered_set seen_windows; + gdb::unordered_set seen_windows; while (true) { spec = skip_spaces (spec); diff --git a/gdb/tui/tui-layout.h b/gdb/tui/tui-layout.h index 22d7c722d6dac66fa1c9525edce7f11f5804ffb1..107b1238652663c411b7cb0de6659c2decc135fc 100644 --- a/gdb/tui/tui-layout.h +++ b/gdb/tui/tui-layout.h @@ -27,8 +27,7 @@ #include "tui/tui.h" #include "tui/tui-data.h" #include "gdbsupport/iterator-range.h" - -#include +#include "gdbsupport/unordered_map.h" /* Values that can be returned when handling a request to adjust a window's size. */ @@ -368,7 +367,7 @@ typedef std::function window_factory; /* The type for a data structure that maps a window name to that window's factory function. */ -typedef std::unordered_map window_types_map; +typedef gdb::unordered_map window_types_map; /* Register a new TUI window type. NAME is the name of the window type. FACTORY is a function that can be called to instantiate the From patchwork Wed Feb 26 01:08:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 107095 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2C2483858C54 for ; Wed, 26 Feb 2025 01:10:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2C2483858C54 Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=WcYijLC7 X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from omta38.uswest2.a.cloudfilter.net (omta38.uswest2.a.cloudfilter.net [35.89.44.37]) by sourceware.org (Postfix) with ESMTPS id 5A9B73858D34 for ; Wed, 26 Feb 2025 01:08:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5A9B73858D34 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 5A9B73858D34 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.37 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1740532096; cv=none; b=EnfyV3qc8BUk88ybR6F0+fGQcGHA3A53ifUuDufM/Sh4tmhz8XFTF8FtX5EjHq7U7qNfPhIV5wmKtFcou0kGMK+S7Mni3z+U7Q0sFuyHh4Vf8Nj19YGI3pQ+htYSEBBOztxqsp73xd9INCOV7rwEgOJlBHX8I2g/abWX+F3+GXk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1740532096; c=relaxed/simple; bh=WXgxhlr230a7I15bSjb7ZK7tSiBNKSCWusGFU07z/FM=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=C8O4/eaYLxiOdToQP3MaiQ+bJ7HJZinV0uQjyfjYsh0pJSzt0XyomITdFSzbc95o7i2jwXlksyEVMPIJ9lfDtg0BVdIce1sjxRBOyfeqjUzSjdJhgmY9cM4kqs7DeL6QHvRGhqgQxVMud89AdKXDsk4rjWZn1H46O0U+g+OY7Qg= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5A9B73858D34 Received: from eig-obgw-6002a.ext.cloudfilter.net ([10.0.30.222]) by cmsmtp with ESMTPS id n5qFtxtVdAfjwn5uJtcStI; Wed, 26 Feb 2025 01:08:15 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id n5uHtZJJNPWBNn5uItXieX; Wed, 26 Feb 2025 01:08:14 +0000 X-Authority-Analysis: v=2.4 cv=A/+nPLWG c=1 sm=1 tr=0 ts=67be697e a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=IkcTkHD0fZMA:10 a=T2h4t0Lz3GQA:10 a=ItBw4LHWJt0A:10 a=i3DrOP8pLJYlABTk9IQA:9 a=QEXdDO2ut3YA:10 a=6Ogn3jAGHLSNbaov7Orx:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Cc:To:In-Reply-To:References:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From:Sender: Reply-To: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=vKry7Lvs+XQa+yfMo6yZU4Avvg/8A506VU6xsAFMJTM=; b=WcYijLC7moN7hz/jmCqVCn1B+8 gsCaaWRQHV7GH4471KLmUj3PfdoOmA47cN3xY1nFmQjRzIqBL+tCNP2EnCg2T432UwH7/pxWi1K7y /VAbMrHRB9t4hAXefwiSuqf5o; Received: from 97-118-36-154.hlrn.qwest.net ([97.118.36.154]:33482 helo=prentzel.local) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.1) (envelope-from ) id 1tn5uH-00000001I51-23ES; Tue, 25 Feb 2025 18:08:13 -0700 From: Tom Tromey Date: Tue, 25 Feb 2025 18:08:10 -0700 Subject: [PATCH 03/10] Use gdb::function_view in iterate_over_threads MIME-Version: 1.0 Message-Id: <20250225-source-cache-hash-v1-3-f937ce22b0e9@tromey.com> References: <20250225-source-cache-hash-v1-0-f937ce22b0e9@tromey.com> In-Reply-To: <20250225-source-cache-hash-v1-0-f937ce22b0e9@tromey.com> To: gdb-patches@sourceware.org Cc: Tom Tromey X-Mailer: b4 0.14.2 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.118.36.154 X-Source-L: No X-Exim-ID: 1tn5uH-00000001I51-23ES X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-118-36-154.hlrn.qwest.net (prentzel.local) [97.118.36.154]:33482 X-Source-Auth: tom+tromey.com X-Email-Count: 4 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfAGLmoZQ14Bk0hB0D7ytEdTM/xpGREb/IPZaEBNBCnAfRYHWutTV4uh/mQO/0RFePNYjwzvbMGuwTv5PSgxlAChorRGZWH+ZewmP9GV34x80Tw3oZ4mZ +mGEzw6Pf2l9dkzO8iUqv8LqK0IgJOhHEIz47E1aPFmp+XxG/4sYMuKKowdiEgsnNrjsKBTCBgtII7aN68YuycFPdryhoYHWSu8= X-Spam-Status: No, score=-3018.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_LOTSOFHASH, PROLO_LEO1, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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~patchwork=sourceware.org@sourceware.org This C++-ifies iterate_over_threads, changing it to accept a gdb::function_view and to return bool. --- gdb/aix-thread.c | 15 +++----- gdb/breakpoint.c | 16 +++------ gdb/fbsd-tdep.c | 10 +++--- gdb/gdbthread.h | 4 +-- gdb/infcmd.c | 12 +++---- gdb/infrun.c | 8 ++--- gdb/mi/mi-main.c | 102 ++++++++++++++++++++----------------------------------- gdb/sol-thread.c | 23 ++++--------- gdb/thread.c | 5 ++- 9 files changed, 70 insertions(+), 125 deletions(-) diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c index 4a050cdff108086ca4bd685cb85836c6bbc71539..f38d19d604db80dc1de50b0094b976b5cf46e98c 100644 --- a/gdb/aix-thread.c +++ b/gdb/aix-thread.c @@ -867,16 +867,6 @@ sync_threadlists (pid_t pid) } } -/* Iterate_over_threads() callback for locating a thread, using - the TID of its associated kernel thread. */ - -static int -iter_tid (struct thread_info *thread, void *tidp) -{ - const pthdb_tid_t tid = *(pthdb_tid_t *)tidp; - return thread->ptid.lwp () == tid; -} - /* Synchronize libpthdebug's state with the inferior and with GDB, generate a composite process/thread for the current thread, Return the ptid of the event thread if one can be found, else @@ -906,7 +896,10 @@ pd_update (pid_t pid) tid = get_signaled_thread (pid); if (tid != 0) - thread = iterate_over_threads (iter_tid, &tid); + thread = iterate_over_threads ([&] (struct thread_info *thread) + { + return thread->ptid.lwp () == tid; + }); if (!thread) ptid = ptid_t (pid); else diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index cf9cd76feb8447742e024050cae55cf2e98538c7..34e32303b02c38a35f0680c06c3020ec66aa3e58 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -11831,16 +11831,6 @@ bpstat_remove_bp_location (bpstat *bps, struct breakpoint *bpt) } } -/* Callback for iterate_over_threads. */ -static int -bpstat_remove_breakpoint_callback (struct thread_info *th, void *data) -{ - struct breakpoint *bpt = (struct breakpoint *) data; - - bpstat_remove_bp_location (th->control.stop_bpstat, bpt); - return 0; -} - /* See breakpoint.h. */ void @@ -12685,7 +12675,11 @@ delete_breakpoint (struct breakpoint *bpt) event-top.c won't do anything, and temporary breakpoints with commands won't work. */ - iterate_over_threads (bpstat_remove_breakpoint_callback, bpt); + iterate_over_threads ([&] (struct thread_info *th) + { + bpstat_remove_bp_location (th->control.stop_bpstat, bpt); + return false; + }); /* Now that breakpoint is removed from breakpoint list, update the global location list. This will remove locations that used to diff --git a/gdb/fbsd-tdep.c b/gdb/fbsd-tdep.c index 804a72c420594b9af92cf3820944d43b91f3eab9..a1e3d819e63afa8dd8da3d3865e7aabde44db1fc 100644 --- a/gdb/fbsd-tdep.c +++ b/gdb/fbsd-tdep.c @@ -637,14 +637,14 @@ fbsd_core_xfer_siginfo (struct gdbarch *gdbarch, gdb_byte *readbuf, return len; } -static int -find_signalled_thread (struct thread_info *info, void *data) +static bool +find_signalled_thread (struct thread_info *info) { if (info->stop_signal () != GDB_SIGNAL_0 && info->ptid.pid () == inferior_ptid.pid ()) - return 1; + return true; - return 0; + return false; } /* Return a byte_vector containing the contents of a core dump note @@ -718,7 +718,7 @@ fbsd_make_corefile_notes (struct gdbarch *gdbarch, bfd *obfd, int *note_size) signalled_thr = curr_thr; else { - signalled_thr = iterate_over_threads (find_signalled_thread, NULL); + signalled_thr = iterate_over_threads (find_signalled_thread); if (signalled_thr == NULL) signalled_thr = curr_thr; } diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h index ee62153551f37d177a43739921ea8f531866a19a..6cffd86bc581f39e890ab770c4e1326f7a30de64 100644 --- a/gdb/gdbthread.h +++ b/gdb/gdbthread.h @@ -734,8 +734,8 @@ void thread_change_ptid (process_stratum_target *targ, /* Iterator function to call a user-provided callback function once for each known thread. */ -typedef int (*thread_callback_func) (struct thread_info *, void *); -extern struct thread_info *iterate_over_threads (thread_callback_func, void *); +typedef gdb::function_view thread_callback_func; +extern struct thread_info *iterate_over_threads (thread_callback_func); /* Pull in the internals of the inferiors/threads ranges and iterators. Must be done after struct thread_info is defined. */ diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 00703e44b7b5e7e070eb2080f96323d68f163609..c428d6ec16af7438fa09fef5d46684b3505d72f6 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -530,8 +530,8 @@ starti_command (const char *args, int from_tty) run_command_1 (args, from_tty, RUN_STOP_AT_FIRST_INSN); } -static int -proceed_thread_callback (struct thread_info *thread, void *arg) +static bool +proceed_thread_callback (struct thread_info *thread) { /* We go through all threads individually instead of compressing into a single target `resume_all' request, because some threads @@ -543,15 +543,15 @@ proceed_thread_callback (struct thread_info *thread, void *arg) thread stopped until I say otherwise', then we can optimize this. */ if (thread->state != THREAD_STOPPED) - return 0; + return false; if (!thread->inf->has_execution ()) - return 0; + return false; switch_to_thread (thread); clear_proceed_status (0); proceed ((CORE_ADDR) -1, GDB_SIGNAL_DEFAULT); - return 0; + return false; } static void @@ -608,7 +608,7 @@ continue_1 (int all_threads) scoped_disable_commit_resumed disable_commit_resumed ("continue all threads in non-stop"); - iterate_over_threads (proceed_thread_callback, nullptr); + iterate_over_threads (proceed_thread_callback); if (current_ui->prompt_state == PROMPT_BLOCKED) { diff --git a/gdb/infrun.c b/gdb/infrun.c index 79fa31e5ee24e42377d768b300bf8096b933827b..9f5b3d473f8a552924eed5a9125e56ca70c05b5f 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -6671,9 +6671,8 @@ restart_threads (struct thread_info *event_thread, inferior *inf) /* Callback for iterate_over_threads. Find a resumed thread that has a pending waitstatus. */ -static int -resumed_thread_with_pending_status (struct thread_info *tp, - void *arg) +static bool +resumed_thread_with_pending_status (struct thread_info *tp) { return tp->resumed () && tp->has_pending_waitstatus (); } @@ -6751,8 +6750,7 @@ finish_step_over (struct execution_control_state *ecs) if (ecs->ws.kind () == TARGET_WAITKIND_THREAD_EXITED) return 0; - pending = iterate_over_threads (resumed_thread_with_pending_status, - nullptr); + pending = iterate_over_threads (resumed_thread_with_pending_status); if (pending != nullptr) { struct thread_info *tp = ecs->event_thread; diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index 446a4f479bd7579ee36c097b3018625e3cdedfb5..96237c33b0db5092c80ddbf9bb1f7319a12b6157 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -250,15 +250,6 @@ proceed_thread (struct thread_info *thread, int pid) proceed ((CORE_ADDR) -1, GDB_SIGNAL_DEFAULT); } -static int -proceed_thread_callback (struct thread_info *thread, void *arg) -{ - int pid = *(int *)arg; - - proceed_thread (thread, pid); - return 0; -} - static void exec_continue (const char *const *argv, int argc) { @@ -288,7 +279,11 @@ exec_continue (const char *const *argv, int argc) pid = inf->pid; } - iterate_over_threads (proceed_thread_callback, &pid); + iterate_over_threads ([&] (struct thread_info *thread) + { + proceed_thread (thread, pid); + return false; + }); disable_commit_resumed.reset_and_commit (); } else @@ -341,21 +336,6 @@ mi_cmd_exec_continue (const char *command, const char *const *argv, int argc) exec_continue (argv, argc); } -static int -interrupt_thread_callback (struct thread_info *thread, void *arg) -{ - int pid = *(int *)arg; - - if (thread->state != THREAD_RUNNING) - return 0; - - if (thread->ptid.pid () != pid) - return 0; - - target_stop (thread->ptid); - return 0; -} - /* Interrupt the execution of the target. Note how we must play around with the token variables, in order to display the current token in the result of the interrupt command, and the previous @@ -385,7 +365,17 @@ mi_cmd_exec_interrupt (const char *command, const char *const *argv, int argc) scoped_disable_commit_resumed disable_commit_resumed ("interrupting all threads of thread group"); - iterate_over_threads (interrupt_thread_callback, &inf->pid); + iterate_over_threads ([&] (struct thread_info *thread) + { + if (thread->state != THREAD_RUNNING) + return false; + + if (thread->ptid.pid () != inf->pid) + return false; + + target_stop (thread->ptid); + return false; + }); } else { @@ -478,18 +468,6 @@ mi_cmd_exec_run (const char *command, const char *const *argv, int argc) } } - -static int -find_thread_of_process (struct thread_info *ti, void *p) -{ - int pid = *(int *)p; - - if (ti->ptid.pid () == pid && ti->state != THREAD_EXITED) - return 1; - - return 0; -} - void mi_cmd_target_detach (const char *command, const char *const *argv, int argc) { @@ -528,7 +506,12 @@ mi_cmd_target_detach (const char *command, const char *const *argv, int argc) /* Pick any thread in the desired process. Current target_detach detaches from the parent of inferior_ptid. */ - tp = iterate_over_threads (find_thread_of_process, &pid); + tp = iterate_over_threads ([&] (struct thread_info *ti) + { + if (ti->ptid.pid () == pid && ti->state != THREAD_EXITED) + return true; + return false; + }); if (!tp) error (_("Thread group is empty")); @@ -600,28 +583,6 @@ mi_cmd_thread_info (const char *command, const char *const *argv, int argc) print_thread_info (current_uiout, argv[0], -1); } -struct collect_cores_data -{ - int pid; - std::set cores; -}; - -static int -collect_cores (struct thread_info *ti, void *xdata) -{ - struct collect_cores_data *data = (struct collect_cores_data *) xdata; - - if (ti->ptid.pid () == data->pid) - { - int core = target_core_of_thread (ti->ptid); - - if (core != -1) - data->cores.insert (core); - } - - return 0; -} - static void print_one_inferior (struct inferior *inferior, bool recurse, const std::set &ids) @@ -630,7 +591,7 @@ print_one_inferior (struct inferior *inferior, bool recurse, if (ids.empty () || (ids.find (inferior->pid) != ids.end ())) { - struct collect_cores_data data; + std::set cores; ui_out_emit_tuple tuple_emitter (uiout, NULL); uiout->field_fmt ("id", "i%d", inferior->num); @@ -646,15 +607,24 @@ print_one_inferior (struct inferior *inferior, bool recurse, if (inferior->pid != 0) { - data.pid = inferior->pid; - iterate_over_threads (collect_cores, &data); + iterate_over_threads ([&] (struct thread_info *ti) + { + if (ti->ptid.pid () == inferior->pid) + { + int core = target_core_of_thread (ti->ptid); + + if (core != -1) + cores.insert (core); + } + return false; + }); } - if (!data.cores.empty ()) + if (!cores.empty ()) { ui_out_emit_list list_emitter (uiout, "cores"); - for (int b : data.cores) + for (int b : cores) uiout->field_signed (NULL, b); } diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c index db86079b3fa667429403c6f1dbf2c66e0a55bb17..820b6f77819fb5c8245ae2509e8462fc97eb24d7 100644 --- a/gdb/sol-thread.c +++ b/gdb/sol-thread.c @@ -1108,25 +1108,16 @@ info_solthreads (const char *args, int from_tty) TD_SIGNO_MASK, TD_THR_ANY_USER_FLAGS); } -/* Callback routine used to find a thread based on the TID part of - its PTID. */ - -static int -thread_db_find_thread_from_tid (struct thread_info *thread, void *data) -{ - ULONGEST *tid = (ULONGEST *) data; - - if (thread->ptid.tid () == *tid) - return 1; - - return 0; -} - ptid_t sol_thread_target::get_ada_task_ptid (long lwp, ULONGEST thread) { - struct thread_info *thread_info = - iterate_over_threads (thread_db_find_thread_from_tid, &thread); + struct thread_info *thread_info + = iterate_over_threads ([&] (struct thread_info *thread) + { + if (thread->ptid.tid () == thread) + return true; + return false; + }); if (thread_info == NULL) { diff --git a/gdb/thread.c b/gdb/thread.c index 5892b158603a7d11cb7c7efc3346f01714797201..8a34671bb6cc0786b63b9a0008b0b0d5eb2a429e 100644 --- a/gdb/thread.c +++ b/gdb/thread.c @@ -602,11 +602,10 @@ find_thread_by_handle (gdb::array_view handle, */ struct thread_info * -iterate_over_threads (int (*callback) (struct thread_info *, void *), - void *data) +iterate_over_threads (gdb::function_view callback) { for (thread_info *tp : all_threads_safe ()) - if ((*callback) (tp, data)) + if (callback (tp)) return tp; return NULL; From patchwork Wed Feb 26 01:08:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 107099 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 89B9C3858D26 for ; Wed, 26 Feb 2025 01:14:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 89B9C3858D26 Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=A7uPqYht X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from omta36.uswest2.a.cloudfilter.net (omta36.uswest2.a.cloudfilter.net [35.89.44.35]) by sourceware.org (Postfix) with ESMTPS id E5DBE3858D33 for ; Wed, 26 Feb 2025 01:08:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E5DBE3858D33 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 E5DBE3858D33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.35 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1740532096; cv=none; b=LkJeOhFDDTgu3TfUdhgcb2J5jOpWV2qkd4fOxOLfc+su/0Mu7COJ35kbgK27fPCnPGgZjfmgEe+0aYZAKPkBkgrGWdBD0TfV15+hl6yzdV/Ah3VyGdS1AYP3M29EsKA84Ib33t2GJ9GihEMl4AoqwtXVfDjT3IGRQ8X/iwY++RY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1740532096; c=relaxed/simple; bh=0KcCMOX7iVMz46dFOvz1xHFbrFaOb5vCvbiTyDvIlvU=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=dvrXxayA1oCmzm9jix2I0QeXwuACAefcemiphOwwbaR90HXPzzHSsD9SPveAuHiUfO9D7vsTS7qlfhzq1R0moOofbzWsajyvtOZf5OGF6x/hL6OmJeMiY3s0cQUk4riJrJJbcDNwdP5L8Yl951b+6hNnQkEz7jxXgZpNj3oZBgs= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E5DBE3858D33 Received: from eig-obgw-6008a.ext.cloudfilter.net ([10.0.30.227]) by cmsmtp with ESMTPS id mp4Ztd23mMETln5uJtyJwu; Wed, 26 Feb 2025 01:08:15 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id n5uItox7IlW1Fn5uItiSq6; Wed, 26 Feb 2025 01:08:14 +0000 X-Authority-Analysis: v=2.4 cv=VbjxPkp9 c=1 sm=1 tr=0 ts=67be697e a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=IkcTkHD0fZMA:10 a=T2h4t0Lz3GQA:10 a=ItBw4LHWJt0A:10 a=Z9xtMWMFZim7hV4g5hcA:9 a=QEXdDO2ut3YA:10 a=6Ogn3jAGHLSNbaov7Orx:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Cc:To:In-Reply-To:References:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From:Sender: Reply-To: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=dZ2EG9NQ9g8XK/XM9LS+Y82UGA8P47D6Wmd5qE1mdso=; b=A7uPqYhtaRimcl0nVLiFd9Wj9F M/A27hpewsPhIg1lBCsrG7PcLX91UKyhNHiKWhYAgpMy2RY/KspwnVoQpdG+Gb4qM1qq7hwkiIR24 0yP7XwP9yRKADwORF+AyWvl0h; Received: from 97-118-36-154.hlrn.qwest.net ([97.118.36.154]:33482 helo=prentzel.local) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.1) (envelope-from ) id 1tn5uH-00000001I51-3YcK; Tue, 25 Feb 2025 18:08:13 -0700 From: Tom Tromey Date: Tue, 25 Feb 2025 18:08:11 -0700 Subject: [PATCH 04/10] Use gdb set and map in mi-main.c MIME-Version: 1.0 Message-Id: <20250225-source-cache-hash-v1-4-f937ce22b0e9@tromey.com> References: <20250225-source-cache-hash-v1-0-f937ce22b0e9@tromey.com> In-Reply-To: <20250225-source-cache-hash-v1-0-f937ce22b0e9@tromey.com> To: gdb-patches@sourceware.org Cc: Tom Tromey X-Mailer: b4 0.14.2 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.118.36.154 X-Source-L: No X-Exim-ID: 1tn5uH-00000001I51-3YcK X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-118-36-154.hlrn.qwest.net (prentzel.local) [97.118.36.154]:33482 X-Source-Auth: tom+tromey.com X-Email-Count: 5 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfBnbqye2f3cY2otOhhhsl7QgqDdps9q+z8bnX9x7XcC8kushYg/k2hRRThVAjb4Lb23KBAMtAnpac1hRrLtViEeJ3CFHAKSnSrAs0pSiUGaL+cePIsF/ YwZu4IREdDxJzPXJ9yq8Som4unOSV5pspq+PmV1Nnn0195qR0Z7mwAwU7cfulqPUTJmEpxLWv17bUy52bKaMySPScW1+GjSZU20= X-Spam-Status: No, score=-3018.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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~patchwork=sourceware.org@sourceware.org This changes mi-main.c to use gdb::unordered_set and gdb::unordered_map. --- gdb/mi/mi-main.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index 96237c33b0db5092c80ddbf9bb1f7319a12b6157..eb7e8e4a90dd63f3689b221e14c3d56a6476e97c 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -57,8 +57,8 @@ #include #include "progspace-and-thread.h" #include "gdbsupport/rsp-low.h" -#include -#include +#include "gdbsupport/unordered_map.h" +#include "gdbsupport/unordered_set.h" enum { @@ -585,13 +585,13 @@ mi_cmd_thread_info (const char *command, const char *const *argv, int argc) static void print_one_inferior (struct inferior *inferior, bool recurse, - const std::set &ids) + const gdb::unordered_set &ids) { struct ui_out *uiout = current_uiout; if (ids.empty () || (ids.find (inferior->pid) != ids.end ())) { - std::set cores; + gdb::unordered_set cores; ui_out_emit_tuple tuple_emitter (uiout, NULL); uiout->field_fmt ("id", "i%d", inferior->num); @@ -650,13 +650,13 @@ output_cores (struct ui_out *uiout, const char *field_name, const char *xcores) } static void -list_available_thread_groups (const std::set &ids, int recurse) +list_available_thread_groups (const gdb::unordered_set &ids, int recurse) { struct ui_out *uiout = current_uiout; /* This keeps a map from integer (pid) to vector of struct osdata_item. The vector contains information about all threads for the given pid. */ - std::map> tree; + gdb::unordered_map> tree; /* get_osdata will throw if it cannot return data. */ std::unique_ptr data = get_osdata ("processes"); @@ -733,7 +733,7 @@ mi_cmd_list_thread_groups (const char *command, const char *const *argv, struct ui_out *uiout = current_uiout; int available = 0; int recurse = 0; - std::set ids; + gdb::unordered_set ids; enum opt { From patchwork Wed Feb 26 01:08:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 107097 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EC5433858C54 for ; Wed, 26 Feb 2025 01:12:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EC5433858C54 Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=Nn4y1stj X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from omta40.uswest2.a.cloudfilter.net (omta40.uswest2.a.cloudfilter.net [35.89.44.39]) by sourceware.org (Postfix) with ESMTPS id 91B033858D35 for ; Wed, 26 Feb 2025 01:08:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 91B033858D35 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 91B033858D35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.39 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1740532096; cv=none; b=JD+SslAFEz/Eq2vkOuHwlf2I7CRQwvclH3BIkcKkhYlepg0cCSy1I9PZ/laQ0IP33zl7SOvdRQ07khEKBelSr45dcBLypAD6HCXc6MzbGgmhLn12d0+9YqrUbCKp0lP+jUX8fVxoRspHUVmyJJTrlWID6cZsRqskEM/EDKQpBuo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1740532096; c=relaxed/simple; bh=OxTbPWq0nlGhUrHW6SdytpvXcFVryXZa0vJohfy7gVw=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=jDh0hm9Qc6e8I+IFFQs4eUPZdy091fg+dBcrtXuoOleS6TnbAPezfo/p+36PQQxOmduxvfhv4T1O0NblxJeICYnDVBiB6h5beHWEsa3s15aJjP+v2zmzhGeSvPbJLLDBHY4y/hH/hTGjQ6xFnuSNkcyG5CzsmPWQqGNvGrHHDN4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 91B033858D35 Received: from eig-obgw-5010a.ext.cloudfilter.net ([10.0.29.199]) by cmsmtp with ESMTPS id muZytTjEAf1UXn5uJtNSS0; Wed, 26 Feb 2025 01:08:15 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id n5uItlsMpeKr6n5uItznaW; Wed, 26 Feb 2025 01:08:15 +0000 X-Authority-Analysis: v=2.4 cv=V4170/ni c=1 sm=1 tr=0 ts=67be697f a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=IkcTkHD0fZMA:10 a=T2h4t0Lz3GQA:10 a=ItBw4LHWJt0A:10 a=2KObASlA2i2GJGosPL8A:9 a=QEXdDO2ut3YA:10 a=6Ogn3jAGHLSNbaov7Orx:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Cc:To:In-Reply-To:References:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From:Sender: Reply-To: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=hlbw4DJqkPH8C64zcG+hXmeuf73kzbOptnt+GCkCxdw=; b=Nn4y1stj4X8JttsHZ//ZelsbRs ilnfnK0KWt3PFAWTwpzW8mxDLcnDwpilEQP6UvQ1D23MNurKAxc+5zxCkwviMrg4k1NDEBPscy4CT DuLL0COApFwaBFF3txh5VrPHe; Received: from 97-118-36-154.hlrn.qwest.net ([97.118.36.154]:33482 helo=prentzel.local) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.1) (envelope-from ) id 1tn5uI-00000001I51-0xa4; Tue, 25 Feb 2025 18:08:14 -0700 From: Tom Tromey Date: Tue, 25 Feb 2025 18:08:12 -0700 Subject: [PATCH 05/10] Use gdb set and map in remote.c MIME-Version: 1.0 Message-Id: <20250225-source-cache-hash-v1-5-f937ce22b0e9@tromey.com> References: <20250225-source-cache-hash-v1-0-f937ce22b0e9@tromey.com> In-Reply-To: <20250225-source-cache-hash-v1-0-f937ce22b0e9@tromey.com> To: gdb-patches@sourceware.org Cc: Tom Tromey X-Mailer: b4 0.14.2 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.118.36.154 X-Source-L: No X-Exim-ID: 1tn5uI-00000001I51-0xa4 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-118-36-154.hlrn.qwest.net (prentzel.local) [97.118.36.154]:33482 X-Source-Auth: tom+tromey.com X-Email-Count: 6 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfBNunMEsWH8murh6co2ykioSE0jvcqLRt0VN0rpa9e+8TkGSVCD75qdNlsGEemsLb/nUqy63e214GdaOxZYg7PD9mfnP/jZC04HR0yBmWRN9xlhjuPlh Un2YdGKXg0xTXlhbJYZhVPMV0tSUXkzVB0tChvN23hxV6pNGcVjRDbA9rpWkIFgY6wxViMg2e5RtGjuttQBoFduppZoHrLX+Xic= X-Spam-Status: No, score=-3018.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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~patchwork=sourceware.org@sourceware.org This changes remote.c to use gdb::unordered_set and gdb::unordered_map. --- gdb/remote.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gdb/remote.c b/gdb/remote.c index 87946490a9e99e9760717af2aae09b8adab1f033..e3397516d4210613c447ee0004410813532ff23c 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -77,7 +77,6 @@ #include "gdbsupport/search.h" #include #include -#include #include "async-event.h" #include "gdbsupport/selftest.h" #include "cli/cli-style.h" @@ -700,7 +699,7 @@ class remote_state /* Contains the regnums of the expedited registers in the last stop reply packet. */ - std::set last_seen_expedited_registers; + gdb::unordered_set last_seen_expedited_registers; private: /* Asynchronous signal handle registered as event loop source for @@ -710,7 +709,7 @@ class remote_state /* Mapping of remote protocol data for each gdbarch. Usually there is only one entry here, though we may see more with stubs that support multi-process. */ - std::unordered_map + gdb::unordered_map m_arch_states; }; From patchwork Wed Feb 26 01:08:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 107102 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1D5D13858D26 for ; Wed, 26 Feb 2025 01:18:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1D5D13858D26 Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=H+dfbSA9 X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from omta38.uswest2.a.cloudfilter.net (omta38.uswest2.a.cloudfilter.net [35.89.44.37]) by sourceware.org (Postfix) with ESMTPS id 533C33858CD1 for ; Wed, 26 Feb 2025 01:08:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 533C33858CD1 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 533C33858CD1 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.37 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1740532097; cv=none; b=dCKi1FK+lzGLRT8r6XJhPfhKj69lUuLrJAybX76NJktXv1egQiC0YMDvZ3r1iBUaSIj6P7UKUS+DNk8/tDzq74/zyIw/XIgjvzi3IVx9mDSqKge2Znyq0tUejX2tpgMd+V8TilcyVtXcKgKujsHTqRL7EzepJ4SnWsf2KSKhKqE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1740532097; c=relaxed/simple; bh=1veWiVvCNOWxYJugMswklTQS8h+MA2eWWV55wIekrvg=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=e4YIGKD2bdN/yYvkmQZ0wei7p1Yxcg1Ikqn0idBmwI/2MlWLGtJfmOC7PN/+jTyI41v3tk1XA9jVE+2crc9paNsbyaSH0IpsSZ5q3C+cCqY81NfVW9/w68/2PqDlRkC67xAqIokdvcg2zMi+gbAZOE4gFmktrbv+qa6lsZQ1sXs= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 533C33858CD1 Received: from eig-obgw-5008a.ext.cloudfilter.net ([10.0.29.246]) by cmsmtp with ESMTPS id muZstug01Afjwn5uKtcSte; Wed, 26 Feb 2025 01:08:16 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id n5uJt0hr6SiAOn5uJth12J; Wed, 26 Feb 2025 01:08:15 +0000 X-Authority-Analysis: v=2.4 cv=RJ61HZi+ c=1 sm=1 tr=0 ts=67be697f a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=IkcTkHD0fZMA:10 a=T2h4t0Lz3GQA:10 a=ItBw4LHWJt0A:10 a=rPKFwKbcyeaITZREs6sA:9 a=QEXdDO2ut3YA:10 a=6Ogn3jAGHLSNbaov7Orx:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Cc:To:In-Reply-To:References:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From:Sender: Reply-To: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=1hFZwN5pYzUZCdNoKnu/LxpHPf7A/dfnZHYAWhRM9s4=; b=H+dfbSA9qEX3E87x2GaDf30TRl TS2rXrzmedPMYuOW59Rq7rgtxmXv+IeCtjM+zXV531xe4CxtDkK3Wsnc3mt84es2/RMmCvaoUAqqM n2A3Mcfp3SNIIeCPSgySbTD3M; Received: from 97-118-36-154.hlrn.qwest.net ([97.118.36.154]:33482 helo=prentzel.local) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.1) (envelope-from ) id 1tn5uI-00000001I51-3ux8; Tue, 25 Feb 2025 18:08:14 -0700 From: Tom Tromey Date: Tue, 25 Feb 2025 18:08:13 -0700 Subject: [PATCH 06/10] Use gdb map in target-connection.c MIME-Version: 1.0 Message-Id: <20250225-source-cache-hash-v1-6-f937ce22b0e9@tromey.com> References: <20250225-source-cache-hash-v1-0-f937ce22b0e9@tromey.com> In-Reply-To: <20250225-source-cache-hash-v1-0-f937ce22b0e9@tromey.com> To: gdb-patches@sourceware.org Cc: Tom Tromey X-Mailer: b4 0.14.2 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.118.36.154 X-Source-L: No X-Exim-ID: 1tn5uI-00000001I51-3ux8 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-118-36-154.hlrn.qwest.net (prentzel.local) [97.118.36.154]:33482 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: MS4xfPlV0zrxkDjkYsrg9Tv6BhQ9sFGaguvPq0IZnumxk+OkIQXpARx5VeR1tEefZEj2uxQtOr04l8GSuIW0nK9DOmkQ95MkA5Z3+4WyMLTqDO/pSw2x+yK9 n0OAyJtIUp4fMMyk/r6ho7WE9/EeDYtYpCmG8sNjc72gyWuYnONMSIMEyiI729hlfhekMWeKWJMpran4j/W8/r9E0PWlMrJcod0= X-Spam-Status: No, score=-3018.7 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 autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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~patchwork=sourceware.org@sourceware.org This changes target-connection.c to use gdb::unordered_map. --- gdb/target-connection.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gdb/target-connection.c b/gdb/target-connection.c index d9a529ae9bb3d979c4d4ce177efc666aefa1ced5..cd9c572ef70d89f5a54968d69f45cd19a62a63b2 100644 --- a/gdb/target-connection.c +++ b/gdb/target-connection.c @@ -19,15 +19,14 @@ #include "target-connection.h" -#include - #include "inferior.h" #include "target.h" #include "observable.h" +#include "gdbsupport/unordered_map.h" /* A map between connection number and representative process_stratum target. */ -static std::map process_targets; +static gdb::unordered_map process_targets; /* The highest connection number ever given to a target. */ static int highest_target_connection_num; From patchwork Wed Feb 26 01:08:14 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 107101 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D44683858D26 for ; Wed, 26 Feb 2025 01:17:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D44683858D26 Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=IijwvqE3 X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from omta034.useast.a.cloudfilter.net (omta034.useast.a.cloudfilter.net [44.202.169.33]) by sourceware.org (Postfix) with ESMTPS id 43F963858D37 for ; Wed, 26 Feb 2025 01:08:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 43F963858D37 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 43F963858D37 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=1740532097; cv=none; b=sFdZk7d31H/ZaLm0hRHzqNB/+HhUdIgrcFuSHn4m5bKiMaZq7U/bbnDlUJWwol+qOZWlxoqlHywgU1uMJetUsyW78cpMuGR3m21E+6VhZHHsPZrDKB0+3BWpHjvgCuLoeOxKKvyUzBdrzpMBOe3DkAj1zQkMW+UoHQmHWsVKRoE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1740532097; c=relaxed/simple; bh=XzctzXNT0t4DVK5nBv5w3eEUCDwh/t+ZDK6rhXSP3bQ=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=jwUgfqefyFxKLaj02gPS/w9Z72Xrc4tuCYGOp5f2nZqO24xnCkYsFLNszjPbwnP4lPiJQILa1Vk6nd6CzFrv9NcHzP69cFUZhJjyXty2UDa/ECVElgksPB7fyvWKrZRQs7b81t1wy6MRyjkNDouejRjXocsiP6F42A3b+uUmIjY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 43F963858D37 Received: from eig-obgw-6004a.ext.cloudfilter.net ([10.0.30.197]) by cmsmtp with ESMTPS id mblGtDl3aXshwn5uKtnFNA; Wed, 26 Feb 2025 01:08:17 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id n5uJty6BBlqdtn5uKttFSk; Wed, 26 Feb 2025 01:08:16 +0000 X-Authority-Analysis: v=2.4 cv=JIzwsNKb c=1 sm=1 tr=0 ts=67be6980 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=IkcTkHD0fZMA:10 a=T2h4t0Lz3GQA:10 a=ItBw4LHWJt0A:10 a=qQ1qcl--KXnmWB3Ct0IA:9 a=QEXdDO2ut3YA:10 a=6Ogn3jAGHLSNbaov7Orx:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Cc:To:In-Reply-To:References:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From:Sender: Reply-To: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=g8WfERtXaEsQNve5HlSgtu2m8StqQypYF5H0rKArpiU=; b=IijwvqE3ikN9gpgwywcbhTxpld jcyTKd2YmMLRUkTtV42BU9Sn32wWT9Ln2+MZelPaLKzesnj6mo4Fyj/tDBNOwrwtcD5WD9VU7c6E/ /VFiCalYcvUBKn6j3OHTTelXf; Received: from 97-118-36-154.hlrn.qwest.net ([97.118.36.154]:33482 helo=prentzel.local) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.1) (envelope-from ) id 1tn5uJ-00000001I51-1OEs; Tue, 25 Feb 2025 18:08:15 -0700 From: Tom Tromey Date: Tue, 25 Feb 2025 18:08:14 -0700 Subject: [PATCH 07/10] Use gdb set in all_non_exited_process_targets MIME-Version: 1.0 Message-Id: <20250225-source-cache-hash-v1-7-f937ce22b0e9@tromey.com> References: <20250225-source-cache-hash-v1-0-f937ce22b0e9@tromey.com> In-Reply-To: <20250225-source-cache-hash-v1-0-f937ce22b0e9@tromey.com> To: gdb-patches@sourceware.org Cc: Tom Tromey X-Mailer: b4 0.14.2 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.118.36.154 X-Source-L: No X-Exim-ID: 1tn5uJ-00000001I51-1OEs X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-118-36-154.hlrn.qwest.net (prentzel.local) [97.118.36.154]:33482 X-Source-Auth: tom+tromey.com X-Email-Count: 8 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfFRICKVDy+0LKMd9fQLtrt+pS28lkrhaYI0SFVCympXpuo6sOdUxyGQw7/Cnn0ZOuQUMENQJXyW3lhw8w4xESIri/tupB0pl+eU2nmvsAcOvqsyA5BVE tEJOheXrvdhMRUoqcwDj30vM4whlMhnhPQpOd/TIkA/yEowJYDvv0ZcqYJFxqoquV38gZTF1VCeZA5BAhk4V9Lx9RxBzntAI+bE= X-Spam-Status: No, score=-3018.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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~patchwork=sourceware.org@sourceware.org This changes all_non_exited_process_targets to return gdb::unordered_set. --- gdb/process-stratum-target.c | 4 ++-- gdb/process-stratum-target.h | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/gdb/process-stratum-target.c b/gdb/process-stratum-target.c index ce8ff28958e0563da16c5cdd08ac1732cc962764..e827f74da1e42feae28caa66f7598fcc1c00c177 100644 --- a/gdb/process-stratum-target.c +++ b/gdb/process-stratum-target.c @@ -195,11 +195,11 @@ process_stratum_target::find_thread (ptid_t ptid) /* See process-stratum-target.h. */ -std::set +gdb::unordered_set all_non_exited_process_targets () { /* Inferiors may share targets. To eliminate duplicates, use a set. */ - std::set targets; + gdb::unordered_set targets; for (inferior *inf : all_non_exited_inferiors ()) targets.insert (inf->process_target ()); diff --git a/gdb/process-stratum-target.h b/gdb/process-stratum-target.h index 8a0e139cd0c2753f979e3b40516a48fb6dc80b9e..5a9b1d37e791317bdeb8e7e9f90e4b4f5ea4cd7e 100644 --- a/gdb/process-stratum-target.h +++ b/gdb/process-stratum-target.h @@ -21,9 +21,9 @@ #define GDB_PROCESS_STRATUM_TARGET_H #include "target.h" -#include #include "gdbsupport/intrusive_list.h" #include "gdbsupport/gdb-checked-static-cast.h" +#include "gdbsupport/unordered_set.h" #include "gdbthread.h" /* Abstract base class inherited by all process_stratum targets. */ @@ -166,7 +166,8 @@ as_process_stratum_target (target_ops *target) /* Return a collection of targets that have non-exited inferiors. */ -extern std::set all_non_exited_process_targets (); +extern gdb::unordered_set + all_non_exited_process_targets (); /* Switch to the first inferior (and program space) of TARGET, and switch to no thread selected. */ From patchwork Wed Feb 26 01:08:15 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 107103 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B98DE3858D26 for ; Wed, 26 Feb 2025 01:19:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B98DE3858D26 Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=SMFUzLrW X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from omta36.uswest2.a.cloudfilter.net (omta36.uswest2.a.cloudfilter.net [35.89.44.35]) by sourceware.org (Postfix) with ESMTPS id 3C5103858CDA for ; Wed, 26 Feb 2025 01:08:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3C5103858CDA 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 3C5103858CDA Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.35 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1740532098; cv=none; b=GrMnjZ2I5m3uWj11WzI9EVAqiSz1EkThQKsBdbGymVObCVd9/RKMgZXhAZmAlQpeMf9oZMRdHmc+9DtzfzW9No/dhDnGVjH4vlrQSdZskv5DXGiv9c0USh9Zcvek1aH7Xx5Ht7PW/1hn41XmwoHHrj6W7h1RjOR/dh3H986K2Z0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1740532098; c=relaxed/simple; bh=vHYU3s7y9y10+7F4x6bc2HT8LHximYaahszixq1+VLs=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=t7eQygqodripiQj7uSvff/PdUJlVZ/fhIatUO+xGG2XvWYhr3qbCiB1a07UpYHbv622GbApo5of66VQPQ47QnHoieTHxAtio3hOPDUd5oceh/Kk4TjIZTw9a5Os5e7xy9wV6VpZNuVuZM37QfGO+vT173lYrzLIiEGG7Sb4gVdI= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3C5103858CDA Received: from eig-obgw-6006a.ext.cloudfilter.net ([10.0.30.182]) by cmsmtp with ESMTPS id n0gvtgHJdMETln5uLtyJxQ; Wed, 26 Feb 2025 01:08:17 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id n5uKtgzLcUTWAn5uKtajMm; Wed, 26 Feb 2025 01:08:16 +0000 X-Authority-Analysis: v=2.4 cv=TZ6QtwQh c=1 sm=1 tr=0 ts=67be6980 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=IkcTkHD0fZMA:10 a=T2h4t0Lz3GQA:10 a=ItBw4LHWJt0A:10 a=VTj630ct98NUh6t_7_oA:9 a=QEXdDO2ut3YA:10 a=6Ogn3jAGHLSNbaov7Orx:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Cc:To:In-Reply-To:References:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From:Sender: Reply-To: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=hEuYSLq60liLfN+cJ3sWXEps+iVuDT2M3aIppjC+k7g=; b=SMFUzLrWBtGuihfVvSGnTgUutj oMGQALrYL8KyHw7gqme+LnshQoKq8bIoxCKyU5CEcw/rN1y0I6+UizbvrJ2ieTnNnvFXNT7Ts0UJR nqQhuOlYAMdil8N55X4J5PKb1; Received: from 97-118-36-154.hlrn.qwest.net ([97.118.36.154]:33482 helo=prentzel.local) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.1) (envelope-from ) id 1tn5uJ-00000001I51-3gvO; Tue, 25 Feb 2025 18:08:15 -0700 From: Tom Tromey Date: Tue, 25 Feb 2025 18:08:15 -0700 Subject: [PATCH 08/10] Use gdb set in dwarf2/aranges.c MIME-Version: 1.0 Message-Id: <20250225-source-cache-hash-v1-8-f937ce22b0e9@tromey.com> References: <20250225-source-cache-hash-v1-0-f937ce22b0e9@tromey.com> In-Reply-To: <20250225-source-cache-hash-v1-0-f937ce22b0e9@tromey.com> To: gdb-patches@sourceware.org Cc: Tom Tromey X-Mailer: b4 0.14.2 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.118.36.154 X-Source-L: No X-Exim-ID: 1tn5uJ-00000001I51-3gvO X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-118-36-154.hlrn.qwest.net (prentzel.local) [97.118.36.154]:33482 X-Source-Auth: tom+tromey.com X-Email-Count: 9 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfPWafDeuO0bniuC1VuHEBelgIaEQwcJE2vr4Rg9ilk+hRcrHmP9VPT4ObAXpd1AVGqPXjUmTwLhSUdX4vXifmi8k1hXolMR3C7FIEatfAXp+KL7D7zwN Lifn36oozajdTzQe98sJ9k4toT3krQAw1x67MIiCuf8C+wD/gVEqqM7nXN5MunI6TkS819f4er4M9sI0Ux1CLmTZ5LBwFEprV4A= X-Spam-Status: No, score=-3018.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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~patchwork=sourceware.org@sourceware.org This changes dwarf2/aranges.c to use gdb::unordered_set. --- gdb/dwarf2/aranges.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/dwarf2/aranges.c b/gdb/dwarf2/aranges.c index b9903084416fb30c1b87c4d83620e90570f1e86d..dbab8c29aef0bdc2cdeb3ddbd1a81644c4d4d643 100644 --- a/gdb/dwarf2/aranges.c +++ b/gdb/dwarf2/aranges.c @@ -58,7 +58,7 @@ read_addrmap_from_aranges (dwarf2_per_objfile *per_objfile, gdb_assert (insertpair.second); } - std::set debug_info_offset_seen; + gdb::unordered_set debug_info_offset_seen; const bfd_endian dwarf5_byte_order = gdbarch_byte_order (gdbarch); const gdb_byte *addr = section->buffer; while (addr < section->buffer + section->size) From patchwork Wed Feb 26 01:08:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 107098 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 013953858C42 for ; Wed, 26 Feb 2025 01:13:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 013953858C42 Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=f0/Ytu8E X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from omta036.useast.a.cloudfilter.net (omta036.useast.a.cloudfilter.net [44.202.169.35]) by sourceware.org (Postfix) with ESMTPS id 71D313858CD9 for ; Wed, 26 Feb 2025 01:08:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 71D313858CD9 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 71D313858CD9 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.35 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1740532097; cv=none; b=ImFxIgW5yxy+y5tVvjtALc8zyIuWKMufvZGqnJkLhvEXyJdVX/rGJ3AJyUllyZWJIObm9nz7pyOBOeW6u1w0fXTcXNhjdsKYUVTm0s9YCM7XHgcg+e8/tP//5OEjcq1pnPTZaaGcmC/2m2g57lTXuZLExOhPEADz2VJlurIUgrQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1740532097; c=relaxed/simple; bh=kaeO+DNN7b0HCsqdzkIydEGpNmTvUAI7vuloBDhbVEY=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=cIO3vMmBLLRK9pw3g3PtCDODBGcwHslGzd5mtiOsh45vYnBvbDe0argM90d0ofPyn+mv/pfA3y+AAap+TVQcK31sae0ncXALYZopdKGQ+qhcebAMVbce0pnBHKgaeE5VNBXqAWZQhV2dLt3k3NSjdpGRtaYa4V1JZTKvkB7m/tQ= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 71D313858CD9 Received: from eig-obgw-5007a.ext.cloudfilter.net ([10.0.29.141]) by cmsmtp with ESMTPS id mbMBtcLM6zZPan5uLtSDIR; Wed, 26 Feb 2025 01:08:17 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id n5uKta9USqwd6n5uKto71V; Wed, 26 Feb 2025 01:08:17 +0000 X-Authority-Analysis: v=2.4 cv=dOygmvZb c=1 sm=1 tr=0 ts=67be6981 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=IkcTkHD0fZMA:10 a=T2h4t0Lz3GQA:10 a=ItBw4LHWJt0A:10 a=ivUOQaqf-oSfuvBAV_8A:9 a=QEXdDO2ut3YA:10 a=6Ogn3jAGHLSNbaov7Orx:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Cc:To:In-Reply-To:References:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From:Sender: Reply-To: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=cprjZXQg6LXShKs1NJYT/wjXaIU+NrwwiKJzp+dpj94=; b=f0/Ytu8ERkhQ97/Uf/F/O7mixK fwYgbPy96MA1NWfnu96iv2WHVB0u404fo/zZstg7nIfqfpT82b7FBLzva7sBbQo9s4YGBGSekVqCV VaiPb7PzW58V0chG5c4A2z5Rz; Received: from 97-118-36-154.hlrn.qwest.net ([97.118.36.154]:33482 helo=prentzel.local) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.1) (envelope-from ) id 1tn5uK-00000001I51-0ngI; Tue, 25 Feb 2025 18:08:16 -0700 From: Tom Tromey Date: Tue, 25 Feb 2025 18:08:16 -0700 Subject: [PATCH 09/10] Use gdb map in py-connection.c MIME-Version: 1.0 Message-Id: <20250225-source-cache-hash-v1-9-f937ce22b0e9@tromey.com> References: <20250225-source-cache-hash-v1-0-f937ce22b0e9@tromey.com> In-Reply-To: <20250225-source-cache-hash-v1-0-f937ce22b0e9@tromey.com> To: gdb-patches@sourceware.org Cc: Tom Tromey X-Mailer: b4 0.14.2 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.118.36.154 X-Source-L: No X-Exim-ID: 1tn5uK-00000001I51-0ngI X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-118-36-154.hlrn.qwest.net (prentzel.local) [97.118.36.154]:33482 X-Source-Auth: tom+tromey.com X-Email-Count: 10 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfPdm779vFtcXa16/Dv37heXKtkzczAV2Z7IjQxndTsSx0CQufRxk7fFYRcVgkFgDB0kGQtwNPsEEu0WTT3+QcyKuHVB32b8NnRxGTzDbodJeL+tu2oXn CFCz9V7R4crk5yDXL6LZ8LCGa2Bngw4gXaFZFsLAmsJ848vJXPxv/AOLSCxqB2dGKCVuK4xy6X4MXrsnIvx6RGYIMlcI8BVP5ZM= X-Spam-Status: No, score=-3017.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_HOSTKARMA_BL, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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~patchwork=sourceware.org@sourceware.org This changes py-connection.c to use gdb::unordered_map. --- gdb/python/py-connection.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gdb/python/py-connection.c b/gdb/python/py-connection.c index 7b5146dbe84254979cc1ead98db440a226a5c3e0..d2cd10df65a9c60e667ed8827e1651a28dda0089 100644 --- a/gdb/python/py-connection.c +++ b/gdb/python/py-connection.c @@ -27,8 +27,7 @@ #include "arch-utils.h" #include "remote.h" #include "charset.h" - -#include +#include "gdbsupport/unordered_map.h" /* The Python object that represents a connection. */ @@ -65,8 +64,8 @@ extern PyTypeObject remote_connection_object_type /* A map between process_stratum targets and the Python object representing them. We actually hold a gdbpy_ref around the Python object so that reference counts are handled correctly when entries are deleted. */ -static std::map> all_connection_objects; +static gdb::unordered_map> all_connection_objects; /* Return a reference to a gdb.TargetConnection object for TARGET. If TARGET is nullptr then a reference to None is returned. From patchwork Wed Feb 26 01:08:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 107096 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 258343858D33 for ; Wed, 26 Feb 2025 01:10:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 258343858D33 Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=cbtZ6R0q X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from omta036.useast.a.cloudfilter.net (omta036.useast.a.cloudfilter.net [44.202.169.35]) by sourceware.org (Postfix) with ESMTPS id 4C9103858C98 for ; Wed, 26 Feb 2025 01:08:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4C9103858C98 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 4C9103858C98 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.35 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1740532098; cv=none; b=f0HEmhLvAF3KIeOzhnjEq5PpzvrUXsB16leyRLpWkG4ns78910i6KsZO1TUGy1ON5nwHOXuy+F/tidlrNfZa+xhvqbrpwaCDB0BeKRIGF1d4Sej3nwUEJm9u7tam9yTp8hS/HaFdJc6NWxJ5mMVyx++0cyu/j2AsLmk22+h5Epw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1740532098; c=relaxed/simple; bh=Wp3IiHPu+U7If1YL4rrbrGHB17182iIu+LAJxKZeQvM=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=GQT5K9E0e0nEx/8wF4QDbREWLuayGYtVpNdqjB9fAt7mtyPjzNS+bs/ZIpH63LKTKMm+iKz2Jbl7jbeTewR2bd5JxsRjpxl12CUamjYwe17bZy3gL8R9LgzIzZ8Qx4pVwTkV6cbjV7xHg1GemVuDREMOfBGE+dMQshiYtqpOfE4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4C9103858C98 Received: from eig-obgw-6007a.ext.cloudfilter.net ([10.0.30.247]) by cmsmtp with ESMTPS id muZltgnjFzZPan5uLtSDIZ; Wed, 26 Feb 2025 01:08:18 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id n5uKtLhKOeosqn5uLtav5Q; Wed, 26 Feb 2025 01:08:17 +0000 X-Authority-Analysis: v=2.4 cv=DKeJ4TNb c=1 sm=1 tr=0 ts=67be6981 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=IkcTkHD0fZMA:10 a=T2h4t0Lz3GQA:10 a=ItBw4LHWJt0A:10 a=635YOV6rsIW43xwmUasA:9 a=QEXdDO2ut3YA:10 a=6Ogn3jAGHLSNbaov7Orx:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Cc:To:In-Reply-To:References:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From:Sender: Reply-To: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=k2HermXcqSmPinlgQw0vg5p9txB/8C3JPVqpX8VvZT4=; b=cbtZ6R0qHFVipLEcSea2pNr4nM 808OHjVojbvkPpQEKCJePGR638s4Vyq/Zxk1CnLXFUGrjualxjw9pI3PWAYGPbgBPSWzPJvS0CsjZ aS5zcdl2WnxTS7UUMtlrYiW5I; Received: from 97-118-36-154.hlrn.qwest.net ([97.118.36.154]:33482 helo=prentzel.local) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.1) (envelope-from ) id 1tn5uK-00000001I51-29DH; Tue, 25 Feb 2025 18:08:16 -0700 From: Tom Tromey Date: Tue, 25 Feb 2025 18:08:17 -0700 Subject: [PATCH 10/10] Use gdb map in mi-cmds.c MIME-Version: 1.0 Message-Id: <20250225-source-cache-hash-v1-10-f937ce22b0e9@tromey.com> References: <20250225-source-cache-hash-v1-0-f937ce22b0e9@tromey.com> In-Reply-To: <20250225-source-cache-hash-v1-0-f937ce22b0e9@tromey.com> To: gdb-patches@sourceware.org Cc: Tom Tromey X-Mailer: b4 0.14.2 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.118.36.154 X-Source-L: No X-Exim-ID: 1tn5uK-00000001I51-29DH X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-118-36-154.hlrn.qwest.net (prentzel.local) [97.118.36.154]:33482 X-Source-Auth: tom+tromey.com X-Email-Count: 11 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfAc/9ePMNATzKz4oVJn3vOJehvWLN525fSXtgLSdBs9bIEypzyaXMz+2wIeQAZMW2KdgymMdLw6OsHyij82C7XprTUBZYjUzeDJHOWohWVIOx7CfyIX+ nCkWIV1rX/RB3v3idHHNgXVf2nwyNfhDeXshwAGuHmR2aHdi2tEkSrb1p5pVQrGv5F+DGPUBPoMpbysi8Vr/UESGOgQbKkm1mBo= X-Spam-Status: No, score=-3017.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_HOSTKARMA_BL, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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~patchwork=sourceware.org@sourceware.org This changes mi-cmds.c to use gdb::unordered_map. --- gdb/mi/mi-cmds.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gdb/mi/mi-cmds.c b/gdb/mi/mi-cmds.c index 02d4dc33ec4121bec96484cff779360c512a4790..6f39989f051833e98999a5c149f1772338c296a3 100644 --- a/gdb/mi/mi-cmds.c +++ b/gdb/mi/mi-cmds.c @@ -21,12 +21,12 @@ #include "mi-cmds.h" #include "mi-main.h" #include "mi-parse.h" -#include +#include "gdbsupport/unordered_map.h" #include /* MI command table (built at run time). */ -static std::map mi_cmd_table; +static gdb::unordered_map mi_cmd_table; /* MI command with a pure MI implementation. */