libdwarf: Reading high pc from a DIE.

libdwarf

Loading...
Searching...
No Matches
Reading high pc from a DIE.

Example get high-pc from a DIE.

Example get high-pc from a DIE.

*/
int examplehighpc(Dwarf_Die die,
Dwarf_Addr *highpc,
Dwarf_Error *error)
{
int res = 0;
Dwarf_Addr localhighpc = 0;
Dwarf_Half form = 0;
enum Dwarf_Form_Class formclass = DW_FORM_CLASS_UNKNOWN;
res = dwarf_highpc_b(die,&localhighpc,
&form,&formclass, error);
if (res != DW_DLV_OK) {
return res;
}
if (form != DW_FORM_addr &&
!dwarf_addr_form_is_indexed(form)) {
Dwarf_Addr low_pc = 0;
/* The localhighpc is an offset from
DW_AT_low_pc.
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_Addr
unsigned long long Dwarf_Addr
Definition libdwarf.h:199
Dwarf_Half
unsigned short Dwarf_Half
Definition libdwarf.h:203
dwarf_highpc_b
DW_API int dwarf_highpc_b(Dwarf_Die dw_die, Dwarf_Addr *dw_return_addr, Dwarf_Half *dw_return_form, enum Dwarf_Form_Class *dw_return_class, Dwarf_Error *dw_error)
Return the DW_AT_hipc address value.
dwarf_addr_form_is_indexed
DW_API Dwarf_Bool dwarf_addr_form_is_indexed(int dw_form)
Informs if a DW_FORM is an indexed form.
Dwarf_Form_Class
Dwarf_Form_Class
Definition libdwarf.h:269