|
libdwarf
|
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. | |
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
| 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
| 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). |
| 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
| 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. |