This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] New register definition interface
- To: ac131313 at cygnus dot com
- Subject: Re: [RFA] New register definition interface
- From: Nick Duffek <nsd at redhat dot com>
- Date: Sat, 13 Jan 2001 14:32:46 -0500
- CC: gdb-patches at sources dot redhat dot com
- References: <3A5F195D.90E4915@cygnus.com>
On 13-Jan-2001, Andrew Cagney wrote:
>I know your code (unfortunatly) won't handle every case (new more bizare
>cases turn up every day)
True. But I am hoping that the new interface will gradually replace the
old and that it will be easy to modify for more bizarre cases.
>[...regarding functions that check REGISTER_LIST...]
>I think these should be made virtual so that your, or any other, code
>can just drop in..
I can remove the REGISTER_LIST references from regcache.c and parse.c as
follows:
1. Create new gdbarch.sh methods REAL_REGISTER, PSEUDO_REGISTER, etc.
to replace those functions in regcache.c and parse.c.
2. Default those new gdbarch.sh methods to non-regs.c versions, and
override them for architectures that opt for regs.c (i.e., in
regs_init_finish()).
Is that what you're suggesting?
However, I can't remove the REGISTER_LIST references from regs.c itself.
regs_init_start (<gdbarch>) initializes a structure containing information
specific to <gdbarch>, and as far as I can tell, there's no other way to
attach that structure to <gdbarch>.
>Did you get VALUE_REGNO() -> VALUE_REGNUM() in that rename?
No, the rename was local to regcache.c.
>The code doesn't appear to help how GDB handles register values in
>expressions and assignments (grep for VALUE_REGNO). Have you thought
>about that?
By "help", do you mean "distinguish between target number and debugging
info number"?
The regs.c interface supports that distinction, but I haven't yet tried
removing the assumption throughout GDB that those two numbers are the
same. Most register numbers throughout GDB are target numbers, so I think
it makes sense to adopt register target numbers as abstract register
handles and replace debugging info numbers with a gdbarch.sh method like
REGISTER_DEBUG_NUMBER (regnum).
I'll implement REGISTER_DEBUG_NUMBER in regs.c with something like this:
static int
regs_register_debug_number (int tnum)
{
struct reg *reg;
reg = find_tnum (tnum, "regs_register_debug_number");
return reg->dnum;
}
Nick