In DWARF3 and DWARF4 the DW_AT_ranges attribute provides an offset into the .debug_ranges section, which contains code address ranges.
- See also
- Dwarf_Ranges
DWARF3 and DWARF4. DW_AT_ranges with an unsigned constant FORM (DWARF3) or DW_FORM_sec_offset(DWARF4).
◆ dwarf_get_ranges_b()
Adds return of the dw_realoffset to accommodate DWARF4 GNU split-dwarf, where the ranges could be in the tieddbg (meaning the real executable, a.out, not in a dwp). DWARF4 split-dwarf is an extension, not standard DWARF4.
If printing all entries in the section pass in an initial dw_rangesoffset of zero and dw_die of NULL. Then increment dw_rangesoffset by dw_bytecount and call again to get the next batch of ranges. With a specific option dwarfdump can do this. This not a normal thing to do!
- See also
- Example getting .debug_ranges data
- Parameters
-
dw_dbg | The Dwarf_Debug of interest |
dw_rangesoffset | The offset to read from in the section. |
dw_die | Pass in the DIE whose DW_AT_ranges brought us to ranges. |
dw_return_realoffset | The actual offset in the section actually read. In a tieddbg this |
dw_rangesbuf | A pointer to an array of structs is returned here. |
dw_rangecount | The count of structs in the array is returned here. |
dw_bytecount | The number of bytes in the .debug_ranges section applying to the returned array. This makes possible just marching through the section by offset. |
dw_error | The usual error detail return pointer. |
- Returns
- Returns DW_DLV_OK etc.
◆ dwarf_dealloc_ranges()
- Parameters
-
dw_dbg | The Dwarf_Debug of interest. |
dw_rangesbuf | The dw_rangesbuf pointer returned by dwarf_get_ranges_b |
dw_rangecount | The dw_rangecount returned by dwarf_get_ranges_b |