aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2025-01-17 10:49:24 -0700
committerTom Tromey <tromey@adacore.com>2025-01-17 10:51:06 -0700
commit56535ffb619362d5f492fddc15aa6aaee47baab4 (patch)
tree149e008499cde126e5fa10bc21eb8687676c7fb8 /gdb/dwarf2
parent6b3000a544a37fcabf59371cb9bba15faf53eb85 (diff)
downloadgdb-56535ffb619362d5f492fddc15aa6aaee47baab4.zip
gdb-56535ffb619362d5f492fddc15aa6aaee47baab4.tar.gz
gdb-56535ffb619362d5f492fddc15aa6aaee47baab4.tar.bz2
Fix self-test crash
My earlier changes introduced a self-test crash. This patch fixes the bug by introducing a new method overload into mock_mapped_index.
Diffstat (limited to 'gdb/dwarf2')
-rw-r--r--gdb/dwarf2/read-gdb-index.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gdb/dwarf2/read-gdb-index.c b/gdb/dwarf2/read-gdb-index.c
index 165816f..a9ae741 100644
--- a/gdb/dwarf2/read-gdb-index.c
+++ b/gdb/dwarf2/read-gdb-index.c
@@ -145,7 +145,9 @@ struct mapped_gdb_index : public dwarf_scanner_base
return symbol_table[2 * idx + 1];
}
- bool symbol_name_slot_invalid (offset_type idx) const
+ /* Return whether the name at IDX in the symbol table should be
+ ignored. */
+ virtual bool symbol_name_slot_invalid (offset_type idx) const
{
return (symbol_name_index (idx) == 0
&& symbol_vec_index (idx) == 0);
@@ -553,6 +555,9 @@ public:
DISABLE_COPY_AND_ASSIGN (mock_mapped_index);
+ bool symbol_name_slot_invalid (offset_type idx) const override
+ { return false; }
+
/* Return the number of names in the symbol table. */
size_t symbol_name_count () const override
{