Example using DWARF2-5 loclists and loc-expressions.
Example using DWARF2-5 loclists and loc-expressions.
Valid for DWARF2 and later DWARF.
This example simply assumes the attribute has a form which relates to location lists or location expressions. Use dwarf_get_form_class() to determine if this attribute fits. Use dwarf_get_version_of_die() to help get the data you need.
- See also
- dwarf_get_form_class
-
dwarf_get_version_of_die
-
Reading a location expression
*/
{
int lres = 0;
&lcount,error);
if (lres == DW_DLV_OK) {
struct Dwarf_Attribute_s * Dwarf_Attribute
Definition libdwarf.h:677
struct Dwarf_Loc_Head_c_s * Dwarf_Loc_Head_c
Definition libdwarf.h:347
struct Dwarf_Error_s * Dwarf_Error
Definition libdwarf.h:611
unsigned long long Dwarf_Unsigned
Definition libdwarf.h:196
DW_API int dwarf_get_loclist_c(Dwarf_Attribute dw_attr, Dwarf_Loc_Head_c *dw_loclist_head, Dwarf_Unsigned *dw_locentry_count, Dwarf_Error *dw_error)
Location Lists and Expressions.