|
int | dwarf_next_cu_header_e (Dwarf_Debug dw_dbg, Dwarf_Bool dw_is_info, Dwarf_Die *dw_cu_die, 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(e). 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(d) More...
|
|
int | dwarf_siblingof_c (Dwarf_Die dw_die, Dwarf_Die *dw_return_siblingdie, Dwarf_Error *dw_error) |
| Return the next sibling DIE. 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_e |
( |
Dwarf_Debug |
dw_dbg, |
|
|
Dwarf_Bool |
dw_is_info, |
|
|
Dwarf_Die * |
dw_cu_die, |
|
|
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 |
|
) |
| |
New in v0.9.0 November 2023.
The library keeps track of where it is in the object file and it knows where to find 'next'.
It returns the CU_DIE pointer through dw_cu_die;
dwarf_next_cu_header_e() is preferred over dwarf_next_cu_header_d() as the latter requires a second (immediate) step to access the CU-DIE of the CU.
With the CU-DIE returned by dwarf_next_cu_header_e() one calls dwarf_child() first (the CU-DIE has no siblings) and then one calls dwarf_siblingof_c() and dwarf_child() appropriately to descend the tree of DIEs.
- Parameters
-
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_die | Pass in a pointer to a Dwarf_Die. the call sets the passed-in pointer to be a Compilation Unit Die for use with dwarf_child() or any other call requiring a Dwarf_Die argument. |
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. |
- Returns
- Returns DW_DLV_OK on success. Returns DW_DLV_NO_ENTRY if all CUs have been read.
- See also
- Example walking CUs(e)
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 |
|
) |
| |
This is the version to use for linking against libdwarf v0.8.0 and earlier (and it also works for later versions).
This version will eventually be deprecated.
The library keeps track of where it is in the object file and it knows where to find 'next'.
In order to read the DIE tree of the CU this records information in the dw_dbg data and after a successful call to dwarf_next_cu_header_d() only an immediate call to dwarf_siblingof_b(dw_dbg,NULL,dw_is_info, &cu_die,...) is guaranteed to return the correct DIE (a Compilation Unit DIE).
Avoid any call to libdwarf between a successful call to dwarf_next_cu_header_d() and dwarf_siblingof_b(dw_dbg,NULL,dw_is_info, &cu_die,...) to ensure the intended and correct Dwarf_Die is returned.
- See also
- Example walking CUs(d)
All arguments are the same as dwarf_next_cu_header_e() except that there is no dw_cu_die argument here.