FYI DWARF .gdb_index-like proposal by Apple

Jan Kratochvil
Mon May 27 17:32:00 GMT 2013

On Mon, 27 May 2013 15:34:10 +0200, Jan Kratochvil wrote:
> just a highlight of submitted DWARF extension with new indexes:
> I have not checked yet if it is sufficient for GDB instead of .gdb_index.

In the proposal ".debug_names" entries for DW_TAG_variable should support also
TLS variables (which do not use DW_OP_addr required by the proposal).

Compared with GDB .gdb_index:

(1) The proposal does not have any address -> name index;
    there is .debug_aranges but that is probably deprecated by the proposal
    above plus it has other issues:

(2) The proposal symbol names are either fully qualified mangled or just
    DW_AT_name; .gdb_index uses demangled fully qualified name.
    The problem is GDB cannot mangle names so GDB would have to make
    the look up via DW_AT_name where may occur many lookup collisions.

(3) .gdb_index has single hash table;
    the proposal uses 3 hash tables, this is less efficient.
    One should use DW_ATOM_die_tag there anyway to look up only symbol kinds
    GDB is interested in - .gdb_index uses it with performance gain in:
    And with DW_ATOM_die_tag present the 3 hash tables could be merged.

(4) .gdb_index provides global/static flag for each symbol;
    one could use new DW_ATOM_* kind but that costs 1 byte, not 1 bit;
    one wants to look up only global symbol first while there are usually many
    static symbols of the same name, performance data is in the same URL above.


More information about the Gdb mailing list