This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: gdbserver for arm-linux
- To: Mark Salter <msalter at redhat dot com>, gdb-patches at sourceware dot cygnus dot com
- Subject: Re: gdbserver for arm-linux
- From: Kevin Buettner <kevinb at cygnus dot com>
- Date: Fri, 11 Aug 2000 11:29:40 -0700
- References: <200008111658.MAA08496@deneb.localdomain>
Mark,
My only comment regarding your gdbserver patches for arm-linux is that
it's rather disconcerting to see two versions of fetch_inferior_registers()
and store_inferior_registers(). (One which is arm specifc and the other
which is generic.)
I wonder if it'd be possible to make the arm versions of these functions
more generic so that they'd be useful by other architectures for
fetching/storing registers that need to use to use ptrace facilities
other than PTRACE_PEEKUSER/PTRACE_POKEUSER?
E.g, maybe something like this:
fetch_inferior_registers (int regno)
{
int rlimit;
int init_state = 1;
if (regno == -1 || regno == 0)
{
regno = 0;
rlimit = NUM_REGS;
}
else
rlimit = regno+1;
while (regno < rlimit)
{
if (!arch_fetch_register (&init_state, regno))
fetch_register (regno);
regno++;
}
}
Then for ARM, you could define the following:
int
arch_fetch_register (int *initstate, int regno)
{
static int gotfp;
if (*initstate)
{
gotfp = 0;
*initstate = 0;
}
if ((regno >= F0_REGNUM) || (regno <= FPS_REGNUM))
{
if (!gotfp)
{
fetch_fpregs ();
gotfp = 1;
}
return 1;
}
return 0;
}
The other architectures which don't have special needs could then
simply define:
int
arch_fetch_register (int *initstate, int regno)
{
return 0;
}