18.6 Extensions to ‘.debug_names

The DWARF specification documents an optional index section called ‘.debug_names’. ROCgdb can both read and create this section. However, in order to work with ROCgdb, some extensions were necessary.

ROCgdb uses an augmentation string to specify which extensions are in use and to allow support of backwards-incompatible changes in this functionality. The augmentation string has the form ‘GDBn’, where n is an integral version number of the extensions, which is incremented when the extensions are added or modified. The smallest n is 2; earlier versions of ROCgdb used just ‘GDB’ with no version number, but these versions of the index are no longer supported.

Here is a list of augmentation string versions along with the changes introduced with each version, compared to the previous version.

GDB2

Specifies the use of attributes DW_IDX_GNU_internal, DW_IDX_GNU_main, DW_IDX_GNU_language and DW_IDX_GNU_linkage_name, described below.

GDB3

Changes the semantic of the DW_IDX_parent attribute. With ‘GDB2’, DW_IDX_parent provided an offset into the name table. With ‘GDB3’, it now provides an offset to the index entry of the parent, relative to the start of the entry pool region.

ROCgdb produces indexes with the augmentation string ‘GDB3’.

ROCgdb can read indexes with augmentation strings ‘GDB2’ or ‘GDB3’. ROCgdb does not support reading indexes with any other augmentation strings.

ROCgdb does not use the specified hash table. Therefore, because this hash table is optional, ROCgdb also does not write it.

ROCgdb generates and uses the following non-standard index attributes:

DW_IDX_GNU_internal

This has the value ‘0x2000’. It is a flag that, when set, indicates that the associated entry has static linkage.

DW_IDX_GNU_main

This has the value ‘0x2002’. It is a flag that, when set, indicates that the associated entry is the program’s main.

DW_IDX_GNU_language

This has the value ‘0x2003’. It is a ‘DW_LANG_’ constant, indicating the language of the associated entry.

DW_IDX_GNU_linkage_name

This has the value ‘0x2004’. It is a flag that, when set, indicates that the associated entry is a linkage name, and not a source name.

ROCgdb also has some special handling for cases not considered in the DWARF specification.