libdwarf
Functions
Fast Access to a CU given a code address

Functions

int dwarf_get_aranges (Dwarf_Debug dw_dbg, Dwarf_Arange **dw_aranges, Dwarf_Signed *dw_arange_count, Dwarf_Error *dw_error)
 Get access to CUs given code addresses. More...
 
int dwarf_get_arange (Dwarf_Arange *dw_aranges, Dwarf_Unsigned dw_arange_count, Dwarf_Addr dw_address, Dwarf_Arange *dw_returned_arange, Dwarf_Error *dw_error)
 Find a range given a code address. More...
 
int dwarf_get_cu_die_offset (Dwarf_Arange dw_arange, Dwarf_Off *dw_return_offset, Dwarf_Error *dw_error)
 Given an arange return its CU DIE offset. More...
 
int dwarf_get_arange_cu_header_offset (Dwarf_Arange dw_arange, Dwarf_Off *dw_return_cu_header_offset, Dwarf_Error *dw_error)
 Given an arange return its CU header offset. More...
 
int dwarf_get_arange_info_b (Dwarf_Arange dw_arange, Dwarf_Unsigned *dw_segment, Dwarf_Unsigned *dw_segment_entry_size, Dwarf_Addr *dw_start, Dwarf_Unsigned *dw_length, Dwarf_Off *dw_cu_die_offset, Dwarf_Error *dw_error)
 Get the data in an arange entry. More...
 

Detailed Description

Function Documentation

◆ dwarf_get_aranges()

int dwarf_get_aranges ( Dwarf_Debug  dw_dbg,
Dwarf_Arange **  dw_aranges,
Dwarf_Signed dw_arange_count,
Dwarf_Error dw_error 
)

This intended as a fast-access to tie code addresses to CU dies. The data is in the .debug_aranges section. which may appear in DWARF2,3,4, or DWARF5.

See also
Reading an aranges section
Parameters
dw_dbgThe Dwarf_Debug of interest.
dw_arangesOn success returns a pointer to an array of Dwarf_Arange pointers.
dw_arange_countOn success returns a count of the length of the array.
dw_errorOn error dw_error is set to point to the error details.
Returns
The usual value: DW_DLV_OK etc. Returns DW_DLV_NO_ENTRY if there is no such section.

◆ dwarf_get_arange()

int dwarf_get_arange ( Dwarf_Arange dw_aranges,
Dwarf_Unsigned  dw_arange_count,
Dwarf_Addr  dw_address,
Dwarf_Arange dw_returned_arange,
Dwarf_Error dw_error 
)
Parameters
dw_arangesPass in a pointer to the first entry in the aranges array of pointers.
dw_arange_countPass in the dw_arange_count, the count for the array.
dw_addressPass in the code address of interest.
dw_returned_arangeOn success, returns the particular arange that holds that address.
dw_errorOn error dw_error is set to point to the error details.
Returns
The usual value: DW_DLV_OK etc. Returns DW_DLV_NO_ENTRY if there is no such code address present in the section.

◆ dwarf_get_cu_die_offset()

int dwarf_get_cu_die_offset ( Dwarf_Arange  dw_arange,
Dwarf_Off dw_return_offset,
Dwarf_Error dw_error 
)
Parameters
dw_arangeThe specific arange of interest.
dw_return_offsetThe CU DIE offset (in .debug_info) applicable to this arange..
dw_errorOn error dw_error is set to point to the error details.
Returns
The usual value: DW_DLV_OK etc.

◆ dwarf_get_arange_cu_header_offset()

int dwarf_get_arange_cu_header_offset ( Dwarf_Arange  dw_arange,
Dwarf_Off dw_return_cu_header_offset,
Dwarf_Error dw_error 
)
Parameters
dw_arangeThe specific arange of interest.
dw_return_cu_header_offsetThe CU header offset (in .debug_info) applicable to this arange.
dw_errorOn error dw_error is set to point to the error details.
Returns
The usual value: DW_DLV_OK etc.

◆ dwarf_get_arange_info_b()

int dwarf_get_arange_info_b ( Dwarf_Arange  dw_arange,
Dwarf_Unsigned dw_segment,
Dwarf_Unsigned dw_segment_entry_size,
Dwarf_Addr dw_start,
Dwarf_Unsigned dw_length,
Dwarf_Off dw_cu_die_offset,
Dwarf_Error dw_error 
)
Parameters
dw_arangeThe specific arange of interest.
dw_segmentOn success and if segment_entry_size is non-zero this returns the segment number from the arange.
dw_segment_entry_sizeOn success returns the segment entry size from the arange.
dw_startOn success returns the low address this arange refers to.
dw_lengthOn success returns the length, in bytes of the code area this arange refers to.
dw_cu_die_offsetOn success returns the .debug_info section offset the arange refers to.
dw_errorOn error dw_error is set to point to the error details.
Returns
The usual value: DW_DLV_OK etc.