Hi Mark, The output from dwarfdump:
< 5><0x00400918:0x00400974><main><cie offset 0x000000b4::cie index 0><fde offset 0x000000b0 length: 0x00000024> <eh aug data len 0x0> 0x00400918: <off cfa=00(r31) > 0x0040091c: <off cfa=32(r31) > <off r29=-32(cfa) > <off r30=-24(cfa) > 0x00400920: <off cfa=32(r29) > <off r29=-32(cfa) > <off r30=-24(cfa) > 0x00400970: <off cfa=00(r31) > I'm getting the rules for r30 at PC 0x0040091c. The value you see -24 from cfa is passed delivered by libdw as: (gdb) p/x locations[i] $19 = {atom = 0x23, number = 0xffffffffffffffe8, number2 = 0x0, offset = 0x0} The atom here is DW_OP_plus_uconst. Previously I have said it was 0xffffffe8, because the printf with specifier %x printed that way. But gdb seems to print its full 8 bytes. I used dwarf_frame_register. Even though, the member number is of unsigned int type with signed encoded values. Am I correct? Sasha From: Mark Wielaard <m...@klomp.org> Sent: Friday, April 26, 2019 3:20 AM To: Sasha Da Rocha Pinheiro; elfutils-devel@sourceware.org Subject: Re: Dwarf_Op Hi Sasha, On Thu, 2019-04-25 at 23:59 +0000, Sasha Da Rocha Pinheiro wrote: > I have a Dwarf_Op object whose member "number" has size of 8 bytes. > Its value although is 0x00000000FFFFFFE8. > Shouldn't it be 0xFFFFFFFFFFFFFFE8 instead? > Since it means an offset, for the current operation, shouldn't it be > of a signed integer type instead of unsigned? Could you provide more information? Which function did you use to get the Dwarf_Op? What was its associated attribute or frame? What is its atom_value? How are you using the Dwarf_Op that requires interpreting its number fields? Thanks, Mark