Semantics of .gdb_index section

Ali Tamur via gdb gdb@sourceware.org
Sat Dec 21 04:01:00 GMT 2019


Hi,
I am trying to debug an elf binary with a .gdb_index section, where gdb
fails.
The .gdb_index section has overlapping address ranges pointing to different
compile units, such as:
[0x100, 0x400) ==> cu_A,
[0x200, 0x300) ==> cu_B.
It seems that the implementation assumes a single compile unit for a given
address. When the user tries
to print a backtrace from a core file, it analyzes the wrong compile unit,
cannot find the range, and
has a gdb_assert failure:

*dwarf2read.c*
static struct compunit_symtab *
dw2_find_pc_sect_compunit_symtab {
   ...
  data = ... addrmap_find ( ... ); // This returns a wrong result.
  ...
  gdb_assert (result != NULL);     // Fails here.
}
I am trying to understand whether this is a shortcoming of gdb, or
whether my .gdb_index section is hopelessly
corrupted. Can gdb_index address ranges contain such overlapping address
pairs?

Thank you,
Ali



More information about the Gdb mailing list