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()



> > 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.


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