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: Richard Earnshaw <rearnsha at arm dot com>
- To: Michael Snyder <msnyder at redhat dot com>
- Cc: Richard dot Earnshaw at arm dot com, Andrew Cagney <ac131313 at cygnus dot com>, gdb-patches at sources dot redhat dot com
- Date: Fri, 17 May 2002 10:06:58 +0100
- Subject: Re: [patch/rfc] Revise REGISTER_SIM_REGNO()
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
> > 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.
Already tried that idea. It doesn't work.
set_register_cached (-1) means that the register is "temporarily
unavailable" at this time (due to the way we gathered the registers).
Each time registers_changed() is called the value is reset to zero.
I need a way the target vector to let REGISTER_NAME() know that the
register is "unavailable this session", so that it can return an empty
string for the register; so that gdb won't think it exists at all.
R.