libdwarf
|
Functions | |
int | dwarf_get_macro_context (Dwarf_Die dw_die, Dwarf_Unsigned *dw_version_out, Dwarf_Macro_Context *dw_macro_context, Dwarf_Unsigned *dw_macro_unit_offset_out, Dwarf_Unsigned *dw_macro_ops_count_out, Dwarf_Unsigned *dw_macro_ops_data_length_out, Dwarf_Error *dw_error) |
DWARF5 .debug_macro access via Dwarf_Die. More... | |
int | dwarf_get_macro_context_by_offset (Dwarf_Die dw_die, Dwarf_Unsigned dw_offset, Dwarf_Unsigned *dw_version_out, Dwarf_Macro_Context *dw_macro_context, Dwarf_Unsigned *dw_macro_ops_count_out, Dwarf_Unsigned *dw_macro_ops_data_length, Dwarf_Error *dw_error) |
DWARF5 .debug_macro access via Dwarf_Die and an offset. More... | |
int | dwarf_macro_context_total_length (Dwarf_Macro_Context dw_context, Dwarf_Unsigned *dw_mac_total_len, Dwarf_Error *dw_error) |
Return a macro context total length. More... | |
void | dwarf_dealloc_macro_context (Dwarf_Macro_Context dw_mc) |
Dealloc a macro context. More... | |
int | dwarf_macro_context_head (Dwarf_Macro_Context dw_mc, Dwarf_Half *dw_version, Dwarf_Unsigned *dw_mac_offset, Dwarf_Unsigned *dw_mac_len, Dwarf_Unsigned *dw_mac_header_len, unsigned int *dw_flags, Dwarf_Bool *dw_has_line_offset, Dwarf_Unsigned *dw_line_offset, Dwarf_Bool *dw_has_offset_size_64, Dwarf_Bool *dw_has_operands_table, Dwarf_Half *dw_opcode_count, Dwarf_Error *dw_error) |
Access the internal details of a Dwarf_Macro_Context. More... | |
int | dwarf_macro_operands_table (Dwarf_Macro_Context dw_mc, Dwarf_Half dw_index, Dwarf_Half *dw_opcode_number, Dwarf_Half *dw_operand_count, const Dwarf_Small **dw_operand_array, Dwarf_Error *dw_error) |
Access to the details of the opcode operands table. More... | |
int | dwarf_get_macro_op (Dwarf_Macro_Context dw_macro_context, Dwarf_Unsigned dw_op_number, Dwarf_Unsigned *dw_op_start_section_offset, Dwarf_Half *dw_macro_operator, Dwarf_Half *dw_forms_count, const Dwarf_Small **dw_formcode_array, Dwarf_Error *dw_error) |
Access macro operation details of a single operation. More... | |
int | dwarf_get_macro_defundef (Dwarf_Macro_Context dw_macro_context, Dwarf_Unsigned dw_op_number, Dwarf_Unsigned *dw_line_number, Dwarf_Unsigned *dw_index, Dwarf_Unsigned *dw_offset, Dwarf_Half *dw_forms_count, const char **dw_macro_string, Dwarf_Error *dw_error) |
Get Macro defundef. More... | |
int | dwarf_get_macro_startend_file (Dwarf_Macro_Context dw_macro_context, Dwarf_Unsigned dw_op_number, Dwarf_Unsigned *dw_line_number, Dwarf_Unsigned *dw_name_index_to_line_tab, const char **dw_src_file_name, Dwarf_Error *dw_error) |
Get Macro start end. More... | |
int | dwarf_get_macro_import (Dwarf_Macro_Context dw_macro_context, Dwarf_Unsigned dw_op_number, Dwarf_Unsigned *dw_target_offset, Dwarf_Error *dw_error) |
Get Macro import. More... | |
Reading the .debug_macro section.
int dwarf_get_macro_context | ( | Dwarf_Die | dw_die, |
Dwarf_Unsigned * | dw_version_out, | ||
Dwarf_Macro_Context * | dw_macro_context, | ||
Dwarf_Unsigned * | dw_macro_unit_offset_out, | ||
Dwarf_Unsigned * | dw_macro_ops_count_out, | ||
Dwarf_Unsigned * | dw_macro_ops_data_length_out, | ||
Dwarf_Error * | dw_error | ||
) |
dw_die | The CU DIE of interest. |
dw_version_out | On success returns the macro context version (5) |
dw_macro_context | On success returns a pointer to a macro context which allows access to the context content. |
dw_macro_unit_offset_out | On success returns the offset of the macro context. |
dw_macro_ops_count_out | On success returns the number of macro operations in the context. |
dw_macro_ops_data_length_out | On success returns the length in bytes of the operations in the context. |
dw_error | The usual error detail return pointer. |
int dwarf_get_macro_context_by_offset | ( | Dwarf_Die | dw_die, |
Dwarf_Unsigned | dw_offset, | ||
Dwarf_Unsigned * | dw_version_out, | ||
Dwarf_Macro_Context * | dw_macro_context, | ||
Dwarf_Unsigned * | dw_macro_ops_count_out, | ||
Dwarf_Unsigned * | dw_macro_ops_data_length, | ||
Dwarf_Error * | dw_error | ||
) |
dw_die | The CU DIE of interest. |
dw_offset | The offset in the section to begin reading. |
dw_version_out | On success returns the macro context version (5) |
dw_macro_context | On success returns a pointer to a macro context which allows access to the context content. |
dw_macro_ops_count_out | On success returns the number of macro operations in the context. |
dw_macro_ops_data_length | On success returns the length in bytes of the macro context, starting at the offset of the first byte of the context. |
dw_error | The usual error detail return pointer. |
int dwarf_macro_context_total_length | ( | Dwarf_Macro_Context | dw_context, |
Dwarf_Unsigned * | dw_mac_total_len, | ||
Dwarf_Error * | dw_error | ||
) |
dw_context | A pointer to the macro context of interest. |
dw_mac_total_len | On success returns the length in bytes of the macro context. |
dw_error | The usual error detail return pointer. |
void dwarf_dealloc_macro_context | ( | Dwarf_Macro_Context | dw_mc | ) |
dw_mc | A pointer to the macro context of interest. On return the caller should zero the pointer as the pointer is then stale. |
int dwarf_macro_context_head | ( | Dwarf_Macro_Context | dw_mc, |
Dwarf_Half * | dw_version, | ||
Dwarf_Unsigned * | dw_mac_offset, | ||
Dwarf_Unsigned * | dw_mac_len, | ||
Dwarf_Unsigned * | dw_mac_header_len, | ||
unsigned int * | dw_flags, | ||
Dwarf_Bool * | dw_has_line_offset, | ||
Dwarf_Unsigned * | dw_line_offset, | ||
Dwarf_Bool * | dw_has_offset_size_64, | ||
Dwarf_Bool * | dw_has_operands_table, | ||
Dwarf_Half * | dw_opcode_count, | ||
Dwarf_Error * | dw_error | ||
) |
Not described in detail here. See DWARF5 Standard Section 6.3.1 Macro Information Header page 166.
int dwarf_macro_operands_table | ( | Dwarf_Macro_Context | dw_mc, |
Dwarf_Half | dw_index, | ||
Dwarf_Half * | dw_opcode_number, | ||
Dwarf_Half * | dw_operand_count, | ||
const Dwarf_Small ** | dw_operand_array, | ||
Dwarf_Error * | dw_error | ||
) |
Not of much interest to most libdwarf users.
dw_mc | The macro context of interest. |
dw_index | The opcode operands table index. 0 through dw_opcode_count-1. |
dw_opcode_number | On success returns the opcode number in the table. |
dw_operand_count | On success returns the number of forms for that dw_index. |
dw_operand_array | On success returns the array of op operand forms |
dw_error | The usual error detail return pointer. |
int dwarf_get_macro_op | ( | Dwarf_Macro_Context | dw_macro_context, |
Dwarf_Unsigned | dw_op_number, | ||
Dwarf_Unsigned * | dw_op_start_section_offset, | ||
Dwarf_Half * | dw_macro_operator, | ||
Dwarf_Half * | dw_forms_count, | ||
const Dwarf_Small ** | dw_formcode_array, | ||
Dwarf_Error * | dw_error | ||
) |
Useful for printing basic data about the operation.
dw_macro_context | The macro context of interest. |
dw_op_number | valid values are 0 through dw_macro_ops_count_out-1. |
dw_op_start_section_offset | On success returns the section offset of this operator. |
dw_macro_operator | On success returns the the macro operator itself, for example DW_MACRO_define. |
dw_forms_count | On success returns the number of forms in the formcode array. |
dw_formcode_array | On success returns a pointer to the formcode array of operand forms. |
dw_error | The usual error detail return pointer. |
int dwarf_get_macro_defundef | ( | Dwarf_Macro_Context | dw_macro_context, |
Dwarf_Unsigned | dw_op_number, | ||
Dwarf_Unsigned * | dw_line_number, | ||
Dwarf_Unsigned * | dw_index, | ||
Dwarf_Unsigned * | dw_offset, | ||
Dwarf_Half * | dw_forms_count, | ||
const char ** | dw_macro_string, | ||
Dwarf_Error * | dw_error | ||
) |
To extract the value portion of a macro define:
dw_macro_context | The macro context of interest. |
dw_op_number | valid values are 0 through dw_macro_ops_count_out-1. The op number must be for a def/undef. |
dw_line_number | The line number in the user source for this define/undef |
dw_index | On success if the macro is an strx form the value returned is the string index in the record, otherwise zero is returned. |
dw_offset | On success if the macro is an strp or sup form the value returned is the string offset in the appropriate section, otherwise zero is returned. |
dw_forms_count | On success the value 2 is returned. |
dw_macro_string | On success a pointer to a null-terminated string is returned. Do not dealloc or free this string. |
dw_error | The usual error detail return pointer. |
int dwarf_get_macro_startend_file | ( | Dwarf_Macro_Context | dw_macro_context, |
Dwarf_Unsigned | dw_op_number, | ||
Dwarf_Unsigned * | dw_line_number, | ||
Dwarf_Unsigned * | dw_name_index_to_line_tab, | ||
const char ** | dw_src_file_name, | ||
Dwarf_Error * | dw_error | ||
) |
dw_macro_context | The macro context of interest. |
dw_op_number | Valid values are 0 through dw_macro_ops_count_out-1. The op number must be for a start/end. |
dw_line_number | If end_file nothing is returned here. If start_file on success returns the line number of the source line of the include directive. |
dw_name_index_to_line_tab | If end_file nothing is returned here. If start_file on success returns the file name index in the line table file names table. |
dw_src_file_name | If end_file nothing is returned here. If start_file on success returns a pointer to the null-terminated source file name. Do not free or dealloc this string. |
dw_error | The usual error detail return pointer. |
int dwarf_get_macro_import | ( | Dwarf_Macro_Context | dw_macro_context, |
Dwarf_Unsigned | dw_op_number, | ||
Dwarf_Unsigned * | dw_target_offset, | ||
Dwarf_Error * | dw_error | ||
) |
dw_macro_context | The macro context of interest. |
dw_op_number | Valid values are 0 through dw_macro_ops_count_out-1. |
dw_target_offset | Returns the offset in the imported section. |
dw_error | The usual error detail return pointer. |