This is the mail archive of the gdb@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

dwarf2read problem


I've been working on implementing something akin to the stabs BINCL
optimization in dwarf2, using .linkonce sections to discard all but one
copy of the debug info for a given header, but gdb fails to grok what I'm
generating.

dwarf2 uses direct references between DIEs (debug info entries).  Within a
dwarf TAG_compilation_unit (CU), these references are usually via offsets
relative to the CU.  But dwarf2 also allows you to refer to another DIE via
an offset from the beginning of the .debug_info section; this allows you to
refer to DIEs in other CUs, for use in optimizations like the one I've been
working on.

dwarf2read.c in GDB currently works by reading in the CU for the symbol we
want and remembering all the DIE offsets within that CU for inter-DIE
references.  Unfortunately, if it encounters a reference to a DIE in
another CU, that's an offset that it doesn't know anything about, so it
fails with "Dwarf Error: Cannot find referent at offset xxx."

Any chance of getting this fixed soon?  There's a simple testcase (source
and Linux/x86/glibc 2.1 executable) at

  http://www.cygnus.com/~jason/ref.tar.gz

Thanks,
Jason

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]