libdwarf
|
Functions | |
int | dwarf_next_cu_header_d (Dwarf_Debug dw_dbg, Dwarf_Bool dw_is_info, Dwarf_Unsigned *dw_cu_header_length, Dwarf_Half *dw_version_stamp, Dwarf_Off *dw_abbrev_offset, Dwarf_Half *dw_address_size, Dwarf_Half *dw_length_size, Dwarf_Half *dw_extension_size, Dwarf_Sig8 *dw_type_signature, Dwarf_Unsigned *dw_typeoffset, Dwarf_Unsigned *dw_next_cu_header_offset, Dwarf_Half *dw_header_cu_type, Dwarf_Error *dw_error) |
Return information on the next CU header. More... | |
int | dwarf_siblingof_b (Dwarf_Debug dw_dbg, Dwarf_Die dw_die, Dwarf_Bool dw_is_info, Dwarf_Die *dw_return_siblingdie, Dwarf_Error *dw_error) |
Return the first DIE or the next sibling DIE. More... | |
int | dwarf_cu_header_basics (Dwarf_Die dw_die, Dwarf_Half *dw_version, Dwarf_Bool *dw_is_info, Dwarf_Bool *dw_is_dwo, Dwarf_Half *dw_offset_size, Dwarf_Half *dw_address_size, Dwarf_Half *dw_extension_size, Dwarf_Sig8 **dw_signature, Dwarf_Off *dw_offset_of_length, Dwarf_Unsigned *dw_total_byte_length, Dwarf_Error *dw_error) |
Return some CU-relative facts. More... | |
int | dwarf_child (Dwarf_Die dw_die, Dwarf_Die *dw_return_childdie, Dwarf_Error *dw_error) |
Return the child DIE, if any. The child may be the first of a list of sibling DIEs. More... | |
void | dwarf_dealloc_die (Dwarf_Die dw_die) |
Deallocate (free) a DIE. More... | |
int | dwarf_die_from_hash_signature (Dwarf_Debug dw_dbg, Dwarf_Sig8 *dw_hash_sig, const char *dw_sig_type, Dwarf_Die *dw_returned_CU_die, Dwarf_Error *dw_error) |
Return a CU DIE given a has signature. More... | |
int | dwarf_offdie_b (Dwarf_Debug dw_dbg, Dwarf_Off dw_offset, Dwarf_Bool dw_is_info, Dwarf_Die *dw_return_die, Dwarf_Error *dw_error) |
Return DIE given global (not CU-relative) offset. More... | |
int | dwarf_find_die_given_sig8 (Dwarf_Debug dw_dbg, Dwarf_Sig8 *dw_ref, Dwarf_Die *dw_die_out, Dwarf_Bool *dw_is_info, Dwarf_Error *dw_error) |
Return a DIE given a Dwarf_Sig8 hash. More... | |
Dwarf_Bool | dwarf_get_die_infotypes_flag (Dwarf_Die dw_die) |
Return the is_info flag. More... | |
int dwarf_next_cu_header_d | ( | Dwarf_Debug | dw_dbg, |
Dwarf_Bool | dw_is_info, | ||
Dwarf_Unsigned * | dw_cu_header_length, | ||
Dwarf_Half * | dw_version_stamp, | ||
Dwarf_Off * | dw_abbrev_offset, | ||
Dwarf_Half * | dw_address_size, | ||
Dwarf_Half * | dw_length_size, | ||
Dwarf_Half * | dw_extension_size, | ||
Dwarf_Sig8 * | dw_type_signature, | ||
Dwarf_Unsigned * | dw_typeoffset, | ||
Dwarf_Unsigned * | dw_next_cu_header_offset, | ||
Dwarf_Half * | dw_header_cu_type, | ||
Dwarf_Error * | dw_error | ||
) |
Return information on the next CU header.
The library keeps track of where it is in the object file and it knows where to find 'next'.
dw_dbg | The Dwarf_Debug of interest. |
dw_is_info | Pass in TRUE if reading through .debug_info Pass in FALSE if reading through DWARF4 .debug_types. |
dw_cu_header_length | Returns the length of the just-read CU header. |
dw_version_stamp | Returns the version number (2 to 5) of the CU header just read. |
dw_abbrev_offset | Returns the .debug_abbrev offset from the the CU header just read. |
dw_address_size | Returns the address size specified for this CU, usually either 4 or 8. |
dw_length_size | Returns the offset size (the length of the size field from the header) specified for this CU, either 4 or 4. |
dw_extension_size | If the section is standard 64bit DWARF then this value is 4. Else the value is zero. |
dw_type_signature | If the CU is DW_UT_skeleton DW_UT_split_compile, DW_UT_split_type or DW_UT_type this is the type signature from the CU_header compiled into this field. |
dw_typeoffset | For DW_UT_split_type or DW_UT_type this is the type offset from the CU header. |
dw_next_cu_header_offset | The offset in the section of the next CU (unless there is a compiler bug this is rarely of interest). |
dw_header_cu_type | Returns DW_UT_compile, or other DW_UT value. |
dw_error | In case return is DW_DLV_ERROR dw_error is set to point to the error details. |
int dwarf_siblingof_b | ( | Dwarf_Debug | dw_dbg, |
Dwarf_Die | dw_die, | ||
Dwarf_Bool | dw_is_info, | ||
Dwarf_Die * | dw_return_siblingdie, | ||
Dwarf_Error * | dw_error | ||
) |
Return the first DIE or the next sibling DIE.
dw_dbg | The Dwarf_Debug one is operating on. |
dw_die | Immediately after calling dwarf_next_cu_header_d pass in NULL to retrieve the CU DIE. Or pass in a known DIE and this will retrieve the next sibling in the chain. |
dw_is_info | Pass TRUE or FALSE to match the applicable dwarf_next_cu_header_d call. |
dw_return_siblingdie | The DIE returned through the pointer. |
dw_error | The usual error information, if any. |
int dwarf_cu_header_basics | ( | Dwarf_Die | dw_die, |
Dwarf_Half * | dw_version, | ||
Dwarf_Bool * | dw_is_info, | ||
Dwarf_Bool * | dw_is_dwo, | ||
Dwarf_Half * | dw_offset_size, | ||
Dwarf_Half * | dw_address_size, | ||
Dwarf_Half * | dw_extension_size, | ||
Dwarf_Sig8 ** | dw_signature, | ||
Dwarf_Off * | dw_offset_of_length, | ||
Dwarf_Unsigned * | dw_total_byte_length, | ||
Dwarf_Error * | dw_error | ||
) |
Return some CU-relative facts.
Any Dwarf_Die will work. The values returned through the pointers are about the CU for a DIE
dw_die | Some open Dwarf_Die. |
dw_version | Returns the DWARF version: 2,3,4, or 5 |
dw_is_info | Returns non-zero if the CU is .debug_info. Returns zero if the CU is .debug_types (DWARF4). |
dw_is_dwo | Returns ton-zero if the CU is a dwo/dwp object and zero if it is a standard object. |
dw_offset_size | Returns offset size, 4 and 8 are possible. |
dw_address_size | Almost always returns 4 or 8. Could be 2 in unusual circumstances. |
dw_extension_size | The sum of dw_offset_size and dw_extension_size are the count of the initial bytes of the CU. Standard lengths are 4 and 12. For 1990's SGI objects the length could be 8. |
dw_signature | Returns a pointer to an 8 byte signature. |
dw_offset_of_length | Returns the section offset of the initial byte of the CU. |
dw_total_byte_length | Returns the total length of the CU including the length field and the content of the CU. |
dw_error | The usual Dwarf_Error*. |
int dwarf_child | ( | Dwarf_Die | dw_die, |
Dwarf_Die * | dw_return_childdie, | ||
Dwarf_Error * | dw_error | ||
) |
Return the child DIE, if any. The child may be the first of a list of sibling DIEs.
dw_die | We will return the first child of this DIE. |
dw_return_childdie | Returns the first child through the pointer. For subsequent dies siblings of the first, use dwarf_siblingof_b(). |
dw_error | The usual Dwarf_Error*. |
void dwarf_dealloc_die | ( | Dwarf_Die | dw_die | ) |
Deallocate (free) a DIE.
dw_die | Frees (deallocs) memory associated with this Dwarf_Die. |
int dwarf_die_from_hash_signature | ( | Dwarf_Debug | dw_dbg, |
Dwarf_Sig8 * | dw_hash_sig, | ||
const char * | dw_sig_type, | ||
Dwarf_Die * | dw_returned_CU_die, | ||
Dwarf_Error * | dw_error | ||
) |
Return a CU DIE given a has signature.
dw_dbg | |
dw_hash_sig | A pointer to an 8 byte signature to be looked up. in .debug_names. |
dw_sig_type | Valid type requests are "cu" and "tu" |
dw_returned_CU_die | Returns the found CU DIE if one is found. |
dw_error | The usual Dwarf_Error*. |
int dwarf_offdie_b | ( | Dwarf_Debug | dw_dbg, |
Dwarf_Off | dw_offset, | ||
Dwarf_Bool | dw_is_info, | ||
Dwarf_Die * | dw_return_die, | ||
Dwarf_Error * | dw_error | ||
) |
Return DIE given global (not CU-relative) offset.
This works whether or not the target section has had dwarf_next_cu_header_d() applied, the CU the offset exists in has been seen at all, or the target offset is one libdwarf has seen before.
dw_dbg | The applicable Dwarf_Debug |
dw_offset | The global offset of the DIE in the appropriate section. |
dw_is_info | Pass TRUE if the target is .debug_info, else pass FALSE if the target is .debug_types. |
dw_return_die | On success this returns a DIE pointer to the found DIE. |
dw_error | The usual Dwarf_Error*. |
int dwarf_find_die_given_sig8 | ( | Dwarf_Debug | dw_dbg, |
Dwarf_Sig8 * | dw_ref, | ||
Dwarf_Die * | dw_die_out, | ||
Dwarf_Bool * | dw_is_info, | ||
Dwarf_Error * | dw_error | ||
) |
Return a DIE given a Dwarf_Sig8 hash.
Returns DIE and is_info flag if it finds the hash signature of a DIE. Often will be the CU DIE of DW_UT_split_type or DW_UT_type CU.
dw_dbg | The applicable Dwarf_Debug |
dw_ref | A pointer to a Dwarf_Sig8 struct whose content defines what is being searched for. |
dw_die_out | If found, this returns the found DIE itself. |
dw_is_info | If found, this returns section (.debug_is_info or .debug_is_types). |
dw_error | The usual error detail return pointer. |
Dwarf_Bool dwarf_get_die_infotypes_flag | ( | Dwarf_Die | dw_die | ) |
Return the is_info flag.
So client software knows if a DIE is in debug_info or (DWARF4-only) debug_types.
dw_die | The DIE being queried. |