From: simon.marchi@polymtl.ca
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@polymtl.ca>
Subject: [PATCH 4/5] gdb/dwarf: rename some abbrev-related things in debug_names writer
Date: Sat, 17 Jan 2026 01:02:34 -0500 [thread overview]
Message-ID: <20260117060335.691691-5-simon.marchi@polymtl.ca> (raw)
In-Reply-To: <20260117060335.691691-1-simon.marchi@polymtl.ca>
From: Simon Marchi <simon.marchi@polymtl.ca>
I think it would be clearer for some of these things to be called
"abbrev", rather than "idx".
Change-Id: Ic128a77dc7ce14a6179c049a2de21f3f9636405d
---
gdb/dwarf2/index-write.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/gdb/dwarf2/index-write.c b/gdb/dwarf2/index-write.c
index 39910cd3f71c..c4bd424d4340 100644
--- a/gdb/dwarf2/index-write.c
+++ b/gdb/dwarf2/index-write.c
@@ -720,17 +720,17 @@ class debug_names
if (parent != nullptr && (parent->flags & IS_SYNTHESIZED) != 0)
parent = nullptr;
- int &idx = m_indexkey_to_idx[index_key (entry->tag,
- kind,
- entry->flags,
- entry->lang,
- parent != nullptr)];
- if (idx == 0)
+ int &abbrev = m_indexkey_to_abbrev[index_key (entry->tag,
+ kind,
+ entry->flags,
+ entry->lang,
+ parent != nullptr)];
+ if (abbrev == 0)
{
- idx = next_abbrev++;
+ abbrev = next_abbrev++;
/* Abbrev number and tag. */
- m_abbrev_table.append_unsigned_leb128 (idx);
+ m_abbrev_table.append_unsigned_leb128 (abbrev);
m_abbrev_table.append_unsigned_leb128 (entry->tag);
/* Unit index. */
@@ -790,7 +790,7 @@ class debug_names
gdb_assert (offset_inserted);
/* Write the entry to the pool, starting with the abbrev number. */
- m_entry_pool.append_unsigned_leb128 (idx);
+ m_entry_pool.append_unsigned_leb128 (abbrev);
/* Unit index. */
const auto it = m_cu_index_htab.find (entry->per_cu);
@@ -1107,8 +1107,8 @@ class debug_names
debug_str_lookup m_debugstrlookup;
/* Map each used .debug_names abbreviation tag parameter to its
- index value. */
- gdb::unordered_map<index_key, int, index_key_hasher> m_indexkey_to_idx;
+ abbrev value. */
+ gdb::unordered_map<index_key, int, index_key_hasher> m_indexkey_to_abbrev;
/* .debug_names abbreviation table. */
data_buf m_abbrev_table;
--
2.52.0
next prev parent reply other threads:[~2026-01-17 6:14 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-17 6:02 [PATCH 0/5] Some semi-random DWARF cleanups simon.marchi
2026-01-17 6:02 ` [PATCH 1/5] gdb/dwarf: merge one CU/TU code path simon.marchi
2026-01-17 6:02 ` [PATCH 2/5] gdb/dwarf: move DWP htab nullptr check to lookup_dwo_unit_in_dwp simon.marchi
2026-01-17 6:02 ` [PATCH 3/5] gdb/dwarf: add comments to debug_names::build simon.marchi
2026-01-17 6:02 ` simon.marchi [this message]
2026-01-17 6:02 ` [PATCH 5/5] gdb/dwarf: add unit_lists structure to index writer simon.marchi
2026-01-20 17:00 ` Tom Tromey
2026-01-20 17:33 ` Simon Marchi
2026-01-20 20:42 ` Tom Tromey
2026-01-20 21:12 ` Simon Marchi
2026-01-20 17:00 ` [PATCH 0/5] Some semi-random DWARF cleanups 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=20260117060335.691691-5-simon.marchi@polymtl.ca \
--to=simon.marchi@polymtl.ca \
--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