This is the mail archive of the gdb-patches@sourceware.org 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: [parisc-linux] [hppa patch] Fix register definitions for hppa


> Isn't there a way we can teach gdb that cr27 is writable via this sequence?
> 
> e.g.
> static inline void __set_cr27(struct pthread *cr27)
> {
>   asm ( "ble    0xe0(%%sr2, %%r0)\n\t"
>         "copy   %0, %%r26"
>         : : "r" (cr27) : "r26" );
> }
> 
> At the very least please adjust the comment to say "cr27 is writable via
> a kernel helper function."
> 
> How does gdb read cr27? It must know how to use mfctl?

Remember that gdb is reading the cr27 of the debuggee, not of itself, so
__set_cr27 is irrelevant.

 From the architecture point of view, CR26 and CR27 are only readable
from userspace, so gdb should not enable somebody to set them from
inside gdb.

GDB gets the value of cr26/cr27 the same way it gets the value of other
registers -- via ptrace or the register set returned in a core dump,
etc...

randolph
-- 
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/


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