From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 1/5] Rename members of index_cache_store_context
Date: Sun, 28 Jan 2024 09:28:05 -0700 [thread overview]
Message-ID: <20240128-pr-31262-index-cache-race-v1-1-4fe53c5265e3@tromey.com> (raw)
In-Reply-To: <20240128-pr-31262-index-cache-race-v1-0-4fe53c5265e3@tromey.com>
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<std::string> dwz_build_id_str;
+ std::optional<std::string> m_dwz_build_id_str;
};
/* Class to manage the access to the DWARF index cache. */
--
2.43.0
next prev parent reply other threads:[~2024-01-28 16:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-28 16:28 [PATCH 0/5] Fix race when writing to index cache Tom Tromey
2024-01-28 16:28 ` Tom Tromey [this message]
2024-01-28 16:28 ` [PATCH 2/5] Capture directory in index_cache_store_context Tom Tromey
2024-01-28 16:28 ` [PATCH 3/5] Capture the per-BFD object " Tom Tromey
2024-01-28 16:28 ` [PATCH 4/5] Move the 'store' method to index_cache_store_context Tom Tromey
2024-01-28 16:28 ` [PATCH 5/5] Avoid race when writing to index cache Tom Tromey
2024-03-09 0:25 ` [PATCH 0/5] Fix " Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240128-pr-31262-index-cache-race-v1-1-4fe53c5265e3@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).