This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Recent changes in dwarf_getlocation


I'm getting some trouble with libdw since changeset:

https://fedorahosted.org/elfutils/changeset/cfdd86ed929c137eaca5dd49cd266bb739c6cdbd

with function dwarf_getlocation, trying to extract position of a data
member.

Given the following code:

/////////////
if(dwarf_hasattr(die, DW_AT_data_member_location))
{
    Dwarf_Attribute attr;
    Dwarf_Op *expr;
    unsigned int exprlen;

    if(dwarf_attr(die, DW_AT_data_member_location, &attr) &&
       dwarf_getlocation(&attr, &expr, &exprlen)!=-1)
    {
        // dwarf_getlocation is returning -1, so
        // this is not executed
    }
}
/////////////

The new function check_constant_offset (attr, llbuf, listlen); is returning
-1 in this case. The attribute that is failing is:

(gdb) p *attr
$26 = {code = 56, form = 10, valp = 0xb7ad1e8b "\002#", cu = 0x80737cc}
DW_AT_data_member_location = 0x38 = 56
DW_FORM_block1 = 0x0a = 10

Am I doing something wrong? Is there another way to extract data member
location info?
Thanks!
I'm getting some trouble with libdw since changeset:

https://fedorahosted.org/elfutils/changeset/cfdd86ed929c137eaca5dd49cd266bb739c6cdbd

with function dwarf_getlocation, trying to extract position of a data member.

Given the following code:

/////////////
if(dwarf_hasattr(die, DW_AT_data_member_location))
{
    Dwarf_Attribute attr;
    Dwarf_Op *expr;
    unsigned int exprlen;

    if(dwarf_attr(die, DW_AT_data_member_location, &attr) &&
       dwarf_getlocation(&attr, &expr, &exprlen)!=-1)
    {
        // dwarf_getlocation is returning -1, so
        // this is not executed
    }
}
/////////////

The new function check_constant_offset (attr, llbuf, listlen); is returning -1 in this case. The attribute that is failing is:

(gdb) p *attr
$26 = {code = 56, form = 10, valp = 0xb7ad1e8b "\002#", cu = 0x80737cc}
DW_AT_data_member_location = 0x38 = 56
DW_FORM_block1 = 0x0a = 10

Am I doing something wrong? Is there another way to extract data member location info?
Thanks!

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]