From patchwork Sun Jan 28 16:28:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 84846 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 1536F385842F for ; Sun, 28 Jan 2024 16:29:40 +0000 (GMT) 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 1031F3858D32 for ; Sun, 28 Jan 2024 16:28:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1031F3858D32 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 1031F3858D32 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=1706459292; cv=none; b=SHYEyb1r+7DQABU36NbxenejtHPdOF/ux7iaGDx/l5CjCQ5DPee4ynZurpZPMBQHRFR5FnF0eW62SvIxBZXfZkckcyUw4DJOVrz90afQdcWxcwHdDY8sPrswmVFWxAUK+X/S7DJKwNWolfyLdmQoA9SDpDcqpmrJeY1QfZLEOWM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706459292; c=relaxed/simple; bh=TsZoGrV+ZVmqIxCC4WgM8UUqUoWqIG26ot2ccEyAycc=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=osV5d9LpIHtvw9MgB6J9GHfDzIHx8QhoQbNdkKpan3bX3ZArxmFaqMxPSOh3Hsj0o++AQ8oPLZ+kWgMnC+uJNnda2o270E5Ue5BTEdn8/RGpsXzCUvWwcEyqslLMxqH7m0HTUm1bttpCFXnCRs5cu2SnPyMTSXCDmXe0fO2bufc= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-5009a.ext.cloudfilter.net ([10.0.29.176]) by cmsmtp with ESMTPS id TyD5rQjjy80oiU80wrP0dE; Sun, 28 Jan 2024 16:28:10 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id U80ur8cfEV9xYU80vr39zR; Sun, 28 Jan 2024 16:28:09 +0000 X-Authority-Analysis: v=2.4 cv=NfP1akP4 c=1 sm=1 tr=0 ts=65b68099 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=IkcTkHD0fZMA:10 a=dEuoMetlWLkA:10 a=Qbun_eYptAEA:10 a=OYXG0DWI0hzoO5mfSTEA: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=V4k+pyGQ6MYm8714ckCysy+NeHJmMuVmknThKgzwRcg=; b=OHGYHP3SZVtIw5fTIZcSk7Q1P7 LTpzJxHvTflpdutmbJViALkY0v01BW2F+ohZaaAoYwcu6aqQoFnnutURY9LcRaJOrrPq9LLHaVsx/ 8aNfsYggU74q0Za8ffTNFhGNk; Received: from 97-122-68-157.hlrn.qwest.net ([97.122.68.157]:36512 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 1rU80u-003tVN-2C for gdb-patches@sourceware.org; Sun, 28 Jan 2024 09:28:08 -0700 From: Tom Tromey Date: Sun, 28 Jan 2024 09:28:05 -0700 Subject: [PATCH 1/5] Rename members of index_cache_store_context MIME-Version: 1.0 Message-Id: <20240128-pr-31262-index-cache-race-v1-1-4fe53c5265e3@tromey.com> References: <20240128-pr-31262-index-cache-race-v1-0-4fe53c5265e3@tromey.com> In-Reply-To: <20240128-pr-31262-index-cache-race-v1-0-4fe53c5265e3@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: 1rU80u-003tVN-2C 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]:36512 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: MS4xfGt1O1Q1KGMlGWbixuRMfy5U7G3+b7JVi/tP1ErTmDlRqll4Dw85ixberWsw2TZQjz4awYGGXeIyQOGeae6sOF24EdBkbRonbZNODYM1TYf/Cksr0t3E +08XbFqzmrCrl1ktmNtZ3pNBkW4aek7HcpjCIAi3p4Fe/3hLuKefsAdsuwTNCoEgWmFR+Bhw75XY34vjsk0BYPbQfI4IFmcsaaw= X-Spam-Status: No, score=-3022.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, 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 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 renames the private members of index_cache_store_context to start with "m_". --- gdb/dwarf2/index-cache.c | 10 +++++----- gdb/dwarf2/index-cache.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gdb/dwarf2/index-cache.c b/gdb/dwarf2/index-cache.c index 7ddd7b3f974..645e36c66f7 100644 --- a/gdb/dwarf2/index-cache.c +++ b/gdb/dwarf2/index-cache.c @@ -104,7 +104,7 @@ index_cache_store_context::index_cache_store_context (const index_cache &ic, m_enabled = false; return; } - build_id_str = build_id_to_string (build_id); + m_build_id_str = build_id_to_string (build_id); /* Get build id of dwz file, if present. */ const dwz_file *dwz = dwarf2_get_dwz_file (per_bfd); @@ -121,7 +121,7 @@ index_cache_store_context::index_cache_store_context (const index_cache &ic, return; } - dwz_build_id_str = build_id_to_string (dwz_build_id); + m_dwz_build_id_str = build_id_to_string (dwz_build_id); } if (ic.m_dir.empty ()) @@ -159,8 +159,8 @@ index_cache::store (dwarf2_per_bfd *per_bfd, if (!ctx.m_enabled) return; - const char *dwz_build_id_ptr = (ctx.dwz_build_id_str.has_value () - ? ctx.dwz_build_id_str->c_str () + const char *dwz_build_id_ptr = (ctx.m_dwz_build_id_str.has_value () + ? ctx.m_dwz_build_id_str->c_str () : nullptr); try @@ -171,7 +171,7 @@ index_cache::store (dwarf2_per_bfd *per_bfd, /* Write the index itself to the directory, using the build id as the filename. */ write_dwarf_index (per_bfd, m_dir.c_str (), - ctx.build_id_str.c_str (), dwz_build_id_ptr, + ctx.m_build_id_str.c_str (), dwz_build_id_ptr, dw_index_kind::GDB_INDEX); } catch (const gdb_exception_error &except) diff --git a/gdb/dwarf2/index-cache.h b/gdb/dwarf2/index-cache.h index db2ec82c958..079ed412d2e 100644 --- a/gdb/dwarf2/index-cache.h +++ b/gdb/dwarf2/index-cache.h @@ -49,10 +49,10 @@ struct index_cache_store_context bool m_enabled; /* Captured value of build id. */ - std::string build_id_str; + std::string m_build_id_str; /* Captured value of dwz build id. */ - std::optional dwz_build_id_str; + std::optional m_dwz_build_id_str; }; /* Class to manage the access to the DWARF index cache. */