This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA/RFC] dwarf2-frame read_reg
Jim Blandy wrote:
On 4/11/06, Michael Snyder <msnyder@redhat.com> wrote:
I want you guys to vett this change. I was getting wrong results
on a target where sizeof (SP) != sizeof (void *). The local func
read_reg was calling extract_unsigned_integer with the wrong size.
Well, extract_typed_address requires the type of the register to be
some sort of pointer. read_reg is given as a callback to the Dwarf
expression evaluator in dwarf2expr.c, so it could be handed any
register at all.
How about unpack_long (buf, register_type (gdbarch, regnum))?
Definitely regression-test this on several platforms...
Hmmm... extract_typed_address calls POINTER_TO_ADDRESS, which
seems more likely to "do the right thing".
How about this?
if (TYPE_CODE (register_type (gdbarch, regnum)) == TYPE_CODE_PTR)
return extract_typed_address (buf, register_type (gdbarch, regnum));
else
return extract_typed_address (buf, builtin_type_void_data_ptr);
(I am assuming that a register_type is unlikely to be TYPE_CODE_REF)