libdwarf
Using dwarf_attrlist()

Example Calling dwarf_attrlist()

*/
int example8(Dwarf_Debug dbg, Dwarf_Die somedie, Dwarf_Error *error)
{
Dwarf_Signed atcount = 0;
Dwarf_Attribute *atlist = 0;
int errv = 0;
Dwarf_Signed i = 0;
errv = dwarf_attrlist(somedie, &atlist,&atcount, error);
if (errv != DW_DLV_OK) {
return errv;
}
for (i = 0; i < atcount; ++i) {
/* use atlist[i] */
atlist[i] = 0;
}
dwarf_dealloc(dbg, atlist, DW_DLA_LIST);
return DW_DLV_OK;
}
struct Dwarf_Debug_s * Dwarf_Debug
Definition: libdwarf.h:586
struct Dwarf_Die_s * Dwarf_Die
Definition: libdwarf.h:591
struct Dwarf_Error_s * Dwarf_Error
Definition: libdwarf.h:580
struct Dwarf_Attribute_s * Dwarf_Attribute
Definition: libdwarf.h:641
void dwarf_dealloc_attribute(Dwarf_Attribute dw_attr)
Dealloc a Dwarf_Attribute When this call returns the dw_attr is a stale pointer.
int dwarf_attrlist(Dwarf_Die dw_die, Dwarf_Attribute **dw_attrbuf, Dwarf_Signed *dw_attrcount, Dwarf_Error *dw_error)
Gets the full list of attributes.
signed long long Dwarf_Signed
Definition: libdwarf.h:197
void dwarf_dealloc(Dwarf_Debug dw_dbg, void *dw_space, Dwarf_Unsigned dw_type)
The generic dealloc (free) function. It requires you know the correct DW_DLA value to pass in,...