This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: dwarf2-frame.c question for maintainers
On Thu, 2004-07-15 at 11:35, Andrew Cagney wrote:
> >>> Consider o32. Both the ABI and ISA are 32-bits, but GDB's CORE_ADDR may
> >>> be 64-bits. Even if it doesn't appear to make a difference, the MIPS
> >>> needs to always sign extend addresses/registers - that's the dogma :-)
> >
> >
> > Right. And so back to the original question. What is the best way to
> > have read_reg detect if it should sign-extend? We agreed that passing a
> > pointer to the CU was out, as was using a global. Do I need to add
> > something to gdbarch?
>
> Hmm, the architecture vector already has POINTER_TO_ADDRESS and
> register_type that can be used to extract [signed] pointers and
> registers. Can either of those be used here?
You mean something like
if (current_gdbarch->pointer_to_address == unsigned_pointer_to_address)
return extract_unsigned_integer (buf, register_size (current_gdbarch, regnum));
else
return extract_signed_integer (buf, register_size (current_gdbarch, regnum));
--
Martin M. Hunt <hunt@redhat.com>
Red Hat Inc.