]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix self-test crash
authorTom Tromey <tromey@adacore.com>
Fri, 17 Jan 2025 17:49:24 +0000 (10:49 -0700)
committerTom Tromey <tromey@adacore.com>
Fri, 17 Jan 2025 17:51:06 +0000 (10:51 -0700)
My earlier changes introduced a self-test crash.  This patch fixes the
bug by introducing a new method overload into mock_mapped_index.

gdb/dwarf2/read-gdb-index.c

index 165816f23e7f970b9fd5ee49fdc6e67b92a9951e..a9ae741cb817db62e0da05badbf8951304414bb3 100644 (file)
@@ -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
   {