libdwarf: Using dwarf_child()

libdwarf

Loading...
Searching...
No Matches
Using dwarf_child()

Example accessing a DIE child.

Example accessing a DIE child.

If the DIE has children (for example inner scopes in a function or members of a struct) this retrieves the DIE which appears first. The child itself may have its own sibling chain.

*/
void example5(Dwarf_Die in_die)
{
Dwarf_Die return_kid = 0;
Dwarf_Error error = 0;
int res = 0;
res = dwarf_child(in_die,&return_kid, &error);
if (res == DW_DLV_OK) {
/* Use return_kid here.
Dwarf_Die
struct Dwarf_Die_s * Dwarf_Die
Definition libdwarf.h:627
Dwarf_Error
struct Dwarf_Error_s * Dwarf_Error
Definition libdwarf.h:611
dwarf_child
DW_API 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.