This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [patch/rfc] Revise REGISTER_SIM_REGNO()
- From: Michael Snyder <msnyder at redhat dot com>
- To: Richard dot Earnshaw at arm dot com
- Cc: Andrew Cagney <ac131313 at cygnus dot com>, gdb-patches at sources dot redhat dot com
- Date: Thu, 16 May 2002 16:21:06 -0700
- Subject: Re: [patch/rfc] Revise REGISTER_SIM_REGNO()
- Organization: Red Hat, Inc.
- References: <200205151045.LAA02092@cam-mail2.cambridge.arm.com>
Richard Earnshaw wrote:
>
> > Hello,
> >
> > The attached, per comments from RichardE, revises the definition and use
> > of REGISTER_SIM_REGNO. I think I've managed to preserve existing behavour.
> >
> > Briefly, REGISTER_SIM_REGNO() [Hmm, do I doco `legacy' behavour?]
> > returns a cardinal indicating the simulators register number, or
> > SIM_REGNO_UNAVAILABLE/-1 when the register isn't there.
> >
> > To preserve current behavour on existing targets,
> > LEGACY_SIM_REGNO_IGNORE is returned by the default
> > legacy_register_sim_regno() function.
>
> I'd like to see a target have a way to report that it is permanently
> unable to recover a register -- because there's nothing in the protocol to
> allow its recovery.
>
> For example, I've added the privileged mode registers to my ARM target
> code; when the target is using a ptrace() interface for debugging a user
> program, then these registers are never available and it's pointless
> having gdb report them.
How about having target_fetch_register set them to -1 in the cache?
See remote.c:remote_fetch_registers:
set_register_cached (i, -1);
This tells the rest of GDB that the value of the register is
"not available". You could unconditionally mark certain regs
as unavailable whenever target_fetch_registers is called.