libdwarf
Functions
Macro Access: DWARF2-4

Functions

char * dwarf_find_macro_value_start (char *dw_macro_string)
 Return a pointer to the value part of a macro. More...
 
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. More...
 

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()

char* dwarf_find_macro_value_start ( char *  dw_macro_string)

This function Works for all versions, DWARF2-DWARF5

Parameters
dw_macro_stringThe 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()

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 
)

An example calling this function

See also
Reading .debug_macinfo (DWARF2-4)
Parameters
dw_dbgThe Dwarf_Debug of interest.
dw_macro_offsetThe offset in the section you wish to start from.
dw_maximum_countPass in a count to ensure we will not allocate an excessive amount (guarding against a
dw_entry_countOn success returns a count of the macro operations in a CU macro set.
dw_detailsOn success returns a pointer to an array of struct DW_Macro_Details_s .
dw_errorThe usual error detail return pointer.
Returns
Returns DW_DLV_OK etc.