libdwarf: Using dwarf_offset_given_die()

libdwarf

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

Example finding the section offset of a DIE.

Example finding the section offset of a DIE.

Here finding the offset of a CU-DIE.

*/
int example7(Dwarf_Debug dbg, Dwarf_Die in_die,
Dwarf_Bool is_info,
Dwarf_Error * error)
{
int res = 0;
Dwarf_Off cudieoff = 0;
Dwarf_Die cudie = 0;
res = dwarf_CU_dieoffset_given_die(in_die,&cudieoff,error);
if (res != DW_DLV_OK) {
/* FAIL
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_Debug
struct Dwarf_Debug_s * Dwarf_Debug
Definition libdwarf.h:617
Dwarf_Off
unsigned long long Dwarf_Off
Definition libdwarf.h:198
Dwarf_Bool
int Dwarf_Bool
Definition libdwarf.h:202
dwarf_CU_dieoffset_given_die
DW_API int dwarf_CU_dieoffset_given_die(Dwarf_Die dw_die, Dwarf_Off *dw_return_offset, Dwarf_Error *dw_error)
Return the CU DIE offset given any DIE.