Gprofng supports DWARF 5 range lists with offset tables.
Gprofng now correctly parses DWARF 5 range lists that use offset tables, fixing issues with function ranges and source location display.
Gprofng has been updated to properly handle DWARF 5 range lists that employ an offsets table, a format used by Clang for non-contiguous code sections. Previously, gprofng misinterpreted these tables, leading to incorrect range information and failures in source location display. This change ensures accurate parsing of these new DWARF 5 constructs.
In Details
This commit enhances gprofng's DWARF parsing to support DWARF 5's DW_FORM_rnglistx, which references an offsets table within .debug_rnglists. Clang uses this for split compilation units (e.g., with -ffunction-sections). The previous implementation incorrectly parsed the offsets table entries as raw ranges and failed to resolve indexed forms like DW_RLE_startx_endx. The fix involves reading the offsets table, properly resolving indexed addresses (via DW_AT_addr_base), and handling new RLE forms like DW_RLE_startx_endx, DW_RLE_startx_length, and DW_RLE_base_addressx. This is essen…
- DW_FORM_rnglistx
- A DWARF form specifier indicating that a range list is referenced by an index into the
.debug_rnglistssection. - DW_AT_rnglists_base
- A DWARF attribute specifying the base offset for range lists when using indexed forms.
- DW_RLE_*x*
- DWARF Range List Entry (RLE) forms that use indexes, requiring resolution through base address attributes.
- .debug_rnglists
- A DWARF section containing range lists, which describe the memory addresses covered by code or data.