This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch/rfc] Revise REGISTER_SIM_REGNO()


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]