libdwarf: Fast Access to a CU given a code address

libdwarf

Loading...
Searching...
No Matches
Functions
Fast Access to a CU given a code address

## Functions
DW_API 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.
DW_API 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.
DW_API 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.
DW_API 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.
DW_API 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.

## Detailed Description

## Function Documentation

## ◆ dwarf_get_arange()

DW_API 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.

Parameters

  dw_aranges | Pass in a pointer to the first entry in the aranges array of pointers.
  dw_arange_count | Pass in the dw_arange_count, the count for the array.
  dw_address | Pass in the code address of interest.
  dw_returned_arange | On success, returns the particular arange that holds that address.
  dw_error | On 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_arange_cu_header_offset()

DW_API 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.

Parameters

  dw_arange | The specific arange of interest.
  dw_return_cu_header_offset | The CU header offset (in .debug_info) applicable to this arange.
  dw_error | On error dw_error is set to point to the error details.

Returns
  The usual value: DW_DLV_OK etc.

## ◆ dwarf_get_arange_info_b()

DW_API 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.

Parameters

  dw_arange | The specific arange of interest.
  dw_segment | On success and if segment_entry_size is non-zero this returns the segment number from the arange.
  dw_segment_entry_size | On success returns the segment entry size from the arange.
  dw_start | On success returns the low address this arange refers to.
  dw_length | On success returns the length, in bytes of the code area this arange refers to.
  dw_cu_die_offset | On success returns the .debug_info section offset the arange refers to.
  dw_error | On error dw_error is set to point to the error details.

Returns
  The usual value: DW_DLV_OK etc.

## ◆ dwarf_get_aranges()

DW_API 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.

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_dbg | The Dwarf_Debug of interest.
  dw_aranges | On success returns a pointer to an array of Dwarf_Arange pointers.
  dw_arange_count | On success returns a count of the length of the array.
  dw_error | On 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_cu_die_offset()

DW_API 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.

Parameters

  dw_arange | The specific arange of interest.
  dw_return_offset | The CU DIE offset (in .debug_info) applicable to this arange..
  dw_error | On error dw_error is set to point to the error details.

Returns
  The usual value: DW_DLV_OK etc.