This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] findvar.c: support LOC_BASEREG[_ARG] on Harvard archs
- To: Andrew Cagney <ac131313 at cygnus dot com>
- Subject: Re: [RFA] findvar.c: support LOC_BASEREG[_ARG] on Harvard archs
- From: Jim Blandy <jimb at zwingli dot cygnus dot com>
- Date: 16 Jul 2001 16:17:45 -0500
- Cc: Nick Duffek <nsd at redhat dot com>, ezannoni at cygnus dot com,gdb-patches at sources dot redhat dot com
- References: <200107161713.f6GHDNC08483@rtl.cygnus.com><3B535097.5040106@cygnus.com>
Andrew Cagney <ac131313@cygnus.com> writes:
> > Index: gdb/findvar.c
> > ===================================================================
> > diff -up gdb/findvar.c gdb/findvar.c> --- gdb/findvar.c Mon Jul 16 12:41:21 2001
> > +++ gdb/findvar.c Mon Jul 16 12:39:40 2001
> > @@ -612,9 +612,10 @@ addresses have not been bound by the dyn
> > case LOC_BASEREG_ARG:
> > {
> > char *buf = (char*) alloca (MAX_REGISTER_RAW_SIZE);
> > + memset (buf, 0, MAX_REGISTER_RAW_SIZE);
> > get_saved_register (buf, NULL, NULL, frame, SYMBOL_BASEREG (var),
> > NULL);
> > - addr = extract_address (buf, REGISTER_RAW_SIZE (SYMBOL_BASEREG (var)));
> > + addr = POINTER_TO_ADDRESS (builtin_type_void_data_ptr, buf);
> > addr += SYMBOL_VALUE (var);
> > break;
>
>
> FYI, I think this change will break the MIPS o64 ABI in big-endian mode.
> Under that ABI, 8 byte registers are used (and saved on the stack) but
> sizeof (void*) == 4. If I'm reading the above change correctly,
> pointer_to_address() will always extract the value from the first 4
> bytes of of the register when, for o64/BE, it should be using the second
> 4 bytes.
That's right, it will. :(
Probably using register_value and value_as_pointer is best, then.