libdwarf: Macro Access: DWARF2-4

libdwarf

Loading...
Searching...
No Matches
Functions
Macro Access: DWARF2-4

## Functions
DW_API char * | dwarf_find_macro_value_start (char *dw_macro_string)
| Return a pointer to the value part of a macro.
DW_API int | dwarf_get_macro_details (Dwarf_Debug dw_dbg, Dwarf_Off dw_macro_offset, Dwarf_Unsigned dw_maximum_count, Dwarf_Signed *dw_entry_count, Dwarf_Macro_Details **dw_details, Dwarf_Error *dw_error)
| Getting .debug_macinfo macro details.

## Detailed Description

Reading the .debug_macinfo section.

The section is rarely used since it takes a lot of disk space. DWARF5 has much more compact macro data (in section .debug_macro).

For an example see

See also
  Reading .debug_macinfo (DWARF2-4) An example reading .debug_macinfo

## Function Documentation

## ◆ dwarf_find_macro_value_start()

DW_API char * dwarf_find_macro_value_start | ( | char * | dw_macro_string | ) |

Return a pointer to the value part of a macro.

This function Works for all versions, DWARF2-DWARF5

Parameters

  dw_macro_string | The macro string passed in should be properly formatted with a name, a space, and then the value portion (whether a function-like macro or not function-like).

Returns
  On success it returns a pointer to the value portion of the macro. On failure it returns a pointer to a NUL byte (so a zero-length string).

## ◆ dwarf_get_macro_details()

DW_API int dwarf_get_macro_details | ( | Dwarf_Debug | dw_dbg,
|  | Dwarf_Off | dw_macro_offset,
|  | Dwarf_Unsigned | dw_maximum_count,
|  | Dwarf_Signed * | dw_entry_count,
|  | Dwarf_Macro_Details ** | dw_details,
|  | Dwarf_Error * | dw_error )

Getting .debug_macinfo macro details.

An example calling this function

See also
  Reading .debug_macinfo (DWARF2-4)

Parameters

  dw_dbg | The Dwarf_Debug of interest.
  dw_macro_offset | The offset in the section you wish to start from.
  dw_maximum_count | Pass in a count to ensure we will not allocate an excessive amount (guarding against a
  dw_entry_count | On success returns a count of the macro operations in a CU macro set.
  dw_details | On success returns a pointer to an array of struct DW_Macro_Details_s .
  dw_error | The usual error detail return pointer.

Returns
  Returns DW_DLV_OK etc.