libdwarf: Abbreviations Section Details

libdwarf

Loading...
Searching...
No Matches
Functions
Abbreviations Section Details

## Functions
DW_API int | dwarf_get_abbrev (Dwarf_Debug dw_dbg, Dwarf_Unsigned dw_offset, Dwarf_Abbrev *dw_returned_abbrev, Dwarf_Unsigned *dw_length, Dwarf_Unsigned *dw_attr_count, Dwarf_Error *dw_error)
| Reading Abbreviation Data.
DW_API int | dwarf_get_abbrev_tag (Dwarf_Abbrev dw_abbrev, Dwarf_Half *dw_return_tag_number, Dwarf_Error *dw_error)
| Get abbreviation tag.
DW_API int | dwarf_get_abbrev_code (Dwarf_Abbrev dw_abbrev, Dwarf_Unsigned *dw_return_code_number, Dwarf_Error *dw_error)
| Get Abbreviation Code.
DW_API int | dwarf_get_abbrev_children_flag (Dwarf_Abbrev dw_abbrev, Dwarf_Signed *dw_return_flag, Dwarf_Error *dw_error)
| Get Abbrev Children Flag.
DW_API int | dwarf_get_abbrev_entry_b (Dwarf_Abbrev dw_abbrev, Dwarf_Unsigned dw_indx, Dwarf_Bool dw_filter_outliers, Dwarf_Unsigned *dw_returned_attr_num, Dwarf_Unsigned *dw_returned_form, Dwarf_Signed *dw_returned_implicit_const, Dwarf_Off *dw_offset, Dwarf_Error *dw_error)
| Get Abbrev Entry Details.

## Detailed Description

Allows reading section .debug_abbrev independently of CUs or DIEs. Normally not done (libdwarf uses it as necessary to access DWARF DIEs and DWARF attributes) unless one is interested in the content of the section.

About Reading Independently.

## Function Documentation

## ◆ dwarf_get_abbrev()

DW_API int dwarf_get_abbrev | ( | Dwarf_Debug | dw_dbg,
|  | Dwarf_Unsigned | dw_offset,
|  | Dwarf_Abbrev * | dw_returned_abbrev,
|  | Dwarf_Unsigned * | dw_length,
|  | Dwarf_Unsigned * | dw_attr_count,
|  | Dwarf_Error * | dw_error )

Reading Abbreviation Data.

Normally you never need to call these functions. Calls that involve DIEs do all this for you behind the scenes in the library.

This reads the data for a single abbrev code starting at dw_offset. Essentially, opening access to an abbreviation entry.

When libdwarf itself reads abbreviations to access DIEs the offset comes from the Compilation Unit Header debug_abbrev_offset field.

See also
  dwarf_next_cu_header_e

Parameters

  dw_dbg | The Dwarf_Debug of interest.
  dw_offset | Pass in the offset where a Debug_Abbrev starts.
  dw_returned_abbrev | On success, sets a pointer to a Dwarf_Abbrev through the pointer to allow further access.
  dw_length | On success, returns the length of the entire abbreviation block (bytes), useful to calculate the next offset if reading the section independently of any compilation unit.
  dw_attr_count | On success, returns the number of attributes in this abbreviation entry.
  dw_error | On error dw_error is set to point to the error details.

Returns
  The usual value: DW_DLV_OK etc. If the abbreviation is a single zero byte it is a null abbreviation. DW_DLV_OK is returned.

Close the abbrev by calling dwarf_dealloc(dbg,*dw_returned_abbrev, DW_DLA_ABBREV)

## ◆ dwarf_get_abbrev_children_flag()

DW_API int dwarf_get_abbrev_children_flag | ( | Dwarf_Abbrev | dw_abbrev,
|  | Dwarf_Signed * | dw_return_flag,
|  | Dwarf_Error * | dw_error )

Get Abbrev Children Flag.

Parameters

  dw_abbrev | The Dwarf_Abbrev of interest.
  dw_return_flag | On success returns the flag TRUE (greater than zero) if the DIE referencing the abbreviation has children, else returns FALSE (zero).
  dw_error | On error dw_error is set to point to the error details.

Returns
  The usual value: DW_DLV_OK etc.

## ◆ dwarf_get_abbrev_code()

DW_API int dwarf_get_abbrev_code | ( | Dwarf_Abbrev | dw_abbrev,
|  | Dwarf_Unsigned * | dw_return_code_number,
|  | Dwarf_Error * | dw_error )

Get Abbreviation Code.

Parameters

  dw_abbrev | The Dwarf_Abbrev of interest.
  dw_return_code_number | Returns the code for this abbreviation, a number assigned to the abbreviation and unique within the applicable CU.
  dw_error | On error dw_error is set to point to the error details.

Returns
  The usual value: DW_DLV_OK etc.

## ◆ dwarf_get_abbrev_entry_b()

DW_API int dwarf_get_abbrev_entry_b | ( | Dwarf_Abbrev | dw_abbrev,
|  | Dwarf_Unsigned | dw_indx,
|  | Dwarf_Bool | dw_filter_outliers,
|  | Dwarf_Unsigned * | dw_returned_attr_num,
|  | Dwarf_Unsigned * | dw_returned_form,
|  | Dwarf_Signed * | dw_returned_implicit_const,
|  | Dwarf_Off * | dw_offset,
|  | Dwarf_Error * | dw_error )

Get Abbrev Entry Details.

Most will will call with filter_outliers non-zero.

Parameters

  dw_abbrev | The Dwarf_Abbrev of interest.
  dw_indx | Valid dw_index values are 0 through dw_attr_count-1
  dw_filter_outliers | Pass non-zero (TRUE) so the function will check for unreasonable abbreviation content and return DW_DLV_ERROR if such found. If zero (FALSE) passed in even a nonsensical attribute number and/or unknown DW_FORM are allowed (used by dwarfdump to report the issue(s)).
  dw_returned_attr_num | On success returns the attribute number, such as DW_AT_name
  dw_returned_form | On success returns the attribute FORM, such as DW_FORM_udata
  dw_returned_implicit_const | On success, if the dw_returned_form is DW_FORM_implicit_const then dw_returned_implicit_const is the implicit const value, but if not implicit const the return value is zero..
  dw_offset | On success returns the offset of the start of this attr/form pair in the abbreviation section.
  dw_error | On error dw_error is set to point to the error details.

Returns
  The usual value: DW_DLV_OK etc. If the abbreviation code for this Dwarf_Abbrev is 0 it is a null abbreviation, the dw_indx is ignored, and the function returns DW_DLV_NO_ENTRY.

## ◆ dwarf_get_abbrev_tag()

DW_API int dwarf_get_abbrev_tag | ( | Dwarf_Abbrev | dw_abbrev,
|  | Dwarf_Half * | dw_return_tag_number,
|  | Dwarf_Error * | dw_error )

Get abbreviation tag.

Parameters

  dw_abbrev | The Dwarf_Abbrev of interest.
  dw_return_tag_number | Returns the tag value, for example DW_TAG_compile_unit.
  dw_error | On error dw_error is set to point to the error details.

Returns
  The usual value: DW_DLV_OK etc.