libdwarf: Fast Access to Split Dwarf (Debug Fission)

libdwarf

Loading...
Searching...
No Matches
Functions
Fast Access to Split Dwarf (Debug Fission)

## Functions
DW_API int | dwarf_get_xu_index_header (Dwarf_Debug dw_dbg, const char *dw_section_type, Dwarf_Xu_Index_Header *dw_xuhdr, Dwarf_Unsigned *dw_version_number, Dwarf_Unsigned *dw_section_count, Dwarf_Unsigned *dw_units_count, Dwarf_Unsigned *dw_hash_slots_count, const char **dw_sect_name, Dwarf_Error *dw_error)
| Access a .debug_cu_index or dw_tu_index section.
DW_API void | dwarf_dealloc_xu_header (Dwarf_Xu_Index_Header dw_xuhdr)
| Dealloc (free) memory associated with dw_xuhdr.
DW_API int | dwarf_get_xu_index_section_type (Dwarf_Xu_Index_Header dw_xuhdr, const char **dw_typename, const char **dw_sectionname, Dwarf_Error *dw_error)
| Return basic information about a Dwarf_Xu_Index_Header.
DW_API int | dwarf_get_xu_hash_entry (Dwarf_Xu_Index_Header dw_xuhdr, Dwarf_Unsigned dw_index, Dwarf_Sig8 *dw_hash_value, Dwarf_Unsigned *dw_index_to_sections, Dwarf_Error *dw_error)
| Get a Hash Entry.
DW_API int | dwarf_get_xu_section_names (Dwarf_Xu_Index_Header dw_xuhdr, Dwarf_Unsigned dw_column_index, Dwarf_Unsigned *dw_SECT_number, const char **dw_SECT_name, Dwarf_Error *dw_error)
| get DW_SECT value for a column.
DW_API int | dwarf_get_xu_section_offset (Dwarf_Xu_Index_Header dw_xuhdr, Dwarf_Unsigned dw_row_index, Dwarf_Unsigned dw_column_index, Dwarf_Unsigned *dw_sec_offset, Dwarf_Unsigned *dw_sec_size, Dwarf_Error *dw_error)
| Get row data (section data) for a row and column.
DW_API int | dwarf_get_debugfission_for_die (Dwarf_Die dw_die, Dwarf_Debug_Fission_Per_CU *dw_percu_out, Dwarf_Error *dw_error)
| Get debugfission data for a Dwarf_Die.
DW_API int | dwarf_get_debugfission_for_key (Dwarf_Debug dw_dbg, Dwarf_Sig8 *dw_hash_sig, const char *dw_cu_type, Dwarf_Debug_Fission_Per_CU *dw_percu_out, Dwarf_Error *dw_error)
| Given a hash signature find per-cu Fission data.

## Detailed Description

## Function Documentation

## ◆ dwarf_dealloc_xu_header()

DW_API void dwarf_dealloc_xu_header | ( | Dwarf_Xu_Index_Header | dw_xuhdr | ) |

Dealloc (free) memory associated with dw_xuhdr.

Should be named dwarf_dealloc_xuhdr instead.

Parameters

  dw_xuhdr | Dealloc (free) all associated memory. The caller should zero the passed in value on return as it is then a stale value.

## ◆ dwarf_get_debugfission_for_die()

DW_API int dwarf_get_debugfission_for_die | ( | Dwarf_Die | dw_die,
|  | Dwarf_Debug_Fission_Per_CU * | dw_percu_out,
|  | Dwarf_Error * | dw_error )

Get debugfission data for a Dwarf_Die.

For any Dwarf_Die in a compilation unit, return the debug fission table data through dw_percu_out. Usually applications will pass in the CU die. Calling code should zero all of the struct Dwarf_Debug_Fission_Per_CU_s before calling this. If there is no debugfission data this returns DW_DLV_NO_ENTRY (only .dwp objects have debugfission data)

Parameters

  dw_die | Pass in a Dwarf_Die pointer, Usually pass in a CU DIE pointer.
  dw_percu_out | Pass in a pointer to a zeroed structure. On success the function fills in the structure.
  dw_error | The usual pointer to return error details.

Returns
  Returns DW_DLV_OK etc.

## ◆ dwarf_get_debugfission_for_key()

DW_API int dwarf_get_debugfission_for_key | ( | Dwarf_Debug | dw_dbg,
|  | Dwarf_Sig8 * | dw_hash_sig,
|  | const char * | dw_cu_type,
|  | Dwarf_Debug_Fission_Per_CU * | dw_percu_out,
|  | Dwarf_Error * | dw_error )

Given a hash signature find per-cu Fission data.

Parameters

  dw_dbg | Pass in the Dwarf_Debug of interest.
  dw_hash_sig | Pass in a pointer to a Dwarf_Sig8 containing a hash value of interest.
  dw_cu_type | Pass in the type, a string. Either "cu" or "tu".
  dw_percu_out | Pass in a pointer to a zeroed structure. On success the function fills in the structure.
  dw_error | The usual pointer to return error details.

Returns
  Returns DW_DLV_OK etc.

## ◆ dwarf_get_xu_hash_entry()

DW_API int dwarf_get_xu_hash_entry | ( | Dwarf_Xu_Index_Header | dw_xuhdr,
|  | Dwarf_Unsigned | dw_index,
|  | Dwarf_Sig8 * | dw_hash_value,
|  | Dwarf_Unsigned * | dw_index_to_sections,
|  | Dwarf_Error * | dw_error )

Get a Hash Entry.

See also
  Reading Split Dwarf (Debug Fission) hash slots

Parameters

  dw_xuhdr | Pass in an open header pointer.
  dw_index | Pass in the index of the entry you wish. Valid index values are 0 through S-1. If the dw_index passed in is outside the valid range the functionj
  dw_hash_value | Pass in a pointer to a Dwarf_Sig8. On success the hash struct is filled in with the 8 byte hash value.
  dw_index_to_sections | On success returns the offset/size table index for this hash entry.
  dw_error | The usual pointer to return error details.

Returns
  Returns DW_DLV_OK on success. If the dw_index passed in is outside the valid range the function it returns DW_DLV_NO_ENTRY (before version 0.7.0 it returned DW_DLV_ERROR, though nothing mentioned that). In case of error it returns DW_DLV_ERROR. If dw_error is non-null returns error details through dw_error (the usual error behavior).

## ◆ dwarf_get_xu_index_header()

DW_API int dwarf_get_xu_index_header | ( | Dwarf_Debug | dw_dbg,
|  | const char * | dw_section_type,
|  | Dwarf_Xu_Index_Header * | dw_xuhdr,
|  | Dwarf_Unsigned * | dw_version_number,
|  | Dwarf_Unsigned * | dw_section_count,
|  | Dwarf_Unsigned * | dw_units_count,
|  | Dwarf_Unsigned * | dw_hash_slots_count,
|  | const char ** | dw_sect_name,
|  | Dwarf_Error * | dw_error )

Access a .debug_cu_index or dw_tu_index section.

These sections are in a DWARF5 package file, a file normally named with the .dwo or .dwp extension.. See DWARF5 section 7.3.5.3 Format of the CU and TU Index Sections.

Parameters

  dw_dbg | Pass in the Dwarf_Debug of interest
  dw_section_type | Pass in a pointer to either "cu" or "tu".
  dw_xuhdr | On success, returns a pointer usable in further calls.
  dw_version_number | On success returns five.
  dw_section_count | On success returns the number of entries in the table of section counts. Referred to as N.
  dw_units_count | On success returns the number of compilation units or type units in the index. Referred to as U.
  dw_hash_slots_count | On success returns the number of slots in the hash table. Referred to as S.
  dw_sect_name | On success returns a pointer to the name of the section. Do not free/dealloc the returned pointer.
  dw_error | The usual pointer to return error details.

Returns
  Returns DW_DLV_OK etc. Returns DW_DLV_NO_ENTRY if the section requested is not present.

## ◆ dwarf_get_xu_index_section_type()

DW_API int dwarf_get_xu_index_section_type | ( | Dwarf_Xu_Index_Header | dw_xuhdr,
|  | const char ** | dw_typename,
|  | const char ** | dw_sectionname,
|  | Dwarf_Error * | dw_error )

Return basic information about a Dwarf_Xu_Index_Header.

Parameters

  dw_xuhdr | Pass in an open header pointer.
  dw_typename | On success returns a pointer to the immutable string "tu" or "cu". Do not free.
  dw_sectionname | On success returns a pointer to the section name in the object file. Do not free.
  dw_error | The usual pointer to return error details.

Returns
  Returns DW_DLV_OK etc.

## ◆ dwarf_get_xu_section_names()

DW_API int dwarf_get_xu_section_names | ( | Dwarf_Xu_Index_Header | dw_xuhdr,
|  | Dwarf_Unsigned | dw_column_index,
|  | Dwarf_Unsigned * | dw_SECT_number,
|  | const char ** | dw_SECT_name,
|  | Dwarf_Error * | dw_error )

get DW_SECT value for a column.

See also
  Reading Split Dwarf (Debug Fission) data

Parameters

  dw_xuhdr | Pass in an open header pointer.
  dw_column_index | The section names are in row zero of the table so we do not mention the row number at all. Pass in the column of the entry you wish. Valid dw_column_index values are 0 through N-1.
  dw_SECT_number | On success returns DW_SECT_INFO or other section id as appears in dw_column_index.
  dw_SECT_name | On success returns a pointer to the string with the section name.
  dw_error | The usual pointer to return error details.

Returns
  Returns DW_DLV_OK etc.

## ◆ dwarf_get_xu_section_offset()

DW_API int dwarf_get_xu_section_offset | ( | Dwarf_Xu_Index_Header | dw_xuhdr,
|  | Dwarf_Unsigned | dw_row_index,
|  | Dwarf_Unsigned | dw_column_index,
|  | Dwarf_Unsigned * | dw_sec_offset,
|  | Dwarf_Unsigned * | dw_sec_size,
|  | Dwarf_Error * | dw_error )

Get row data (section data) for a row and column.

The section offset represents a base offset for the section the row data refers to. DWARF6 Section 7.3.5.3 page 193.

Parameters

  dw_xuhdr | Pass in an open header pointer.
  dw_row_index | Pass in a row number , 1 through U
  dw_column_index | Pass in a column number , 0 through N-1
  dw_sec_offset | On success returns the section offset of the section whose name dwarf_get_xu_section_names returns.
  dw_sec_size | On success returns the section size of the section whose name dwarf_get_xu_section_names returns. If the returned section size is zero then this column makes no contribution to the dwp object file and the dw_sec_size and dw_sec_offset shoul be ignored.
  dw_error | The usual pointer to return error details.

Returns
  Returns DW_DLV_OK etc.