This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
Re: gdb/854: gdb HC11/HC12 broken due to regcache
- From: Andrew Cagney <ac131313 at redhat dot com>
- To: nobody at sources dot redhat dot com
- Cc: gdb-prs at sources dot redhat dot com,
- Date: 28 Nov 2002 22:48:01 -0000
- Subject: Re: gdb/854: gdb HC11/HC12 broken due to regcache
- Reply-to: Andrew Cagney <ac131313 at redhat dot com>
The following reply was made to PR gdb/854; it has been noted by GNATS.
From: Andrew Cagney <ac131313@redhat.com>
To: Stephane.Carrez@nerim.fr
Cc: gdb-gnats@sources.redhat.com
Subject: Re: gdb/854: gdb HC11/HC12 broken due to regcache
Date: Thu, 28 Nov 2002 17:40:27 -0500
> gdb for m6811-elf is broken due to the new regcache.
>
> The regcache only saves the real hard register and does not
> save the HC11/HC12 memory registers. The frame pointer is
> also a memory register and it is not saved by the regcache.
> This results in wrong behavior when using backtrace and
> when gdb call a target function (because the generic_dummy
> frame only saves the regcache, and the HC11/HC12 memory
> registers {and in particular the frame} are not saved).
>
>>How-To-Repeat:
>
> Run gdb validation and in particular
> testsuite/gdb.base/callfuncs.exp
>
>>Fix:
>
> Must save the HC11/HC12 memory registers
I knew it! The regcache code should be able to accomodate this vis:
/* Copy over any registers (identified by their membership in the
save_reggroup) and mark them as valid. The full [0
.. NUM_REGS+NUM_PSEUDO_REGS) range is checked since some
architectures need to save/restore `cooked' registers that live
in memory. */
You should be able to define a local m68hc11_register_reggroup_p() that
is something like:
if (reggroup == save_reggroup
|| reggroup == restore_reggroup)
return one when it is one of th registers that need saving/restoring;
return default_register_reggroup_p (reggroup, regnum);
while you're at it you may want to refine some of the other reggroups so
that they better reflect you're architectures reality (see the i386
for an example).