Re: [hppa patch] Fix register definitions for hppa
"Carlos O'Donell" <[email protected]> Fri, 3 Aug 2007 14:32:41 -0400
| Newsgroups | gmane.linux.ports.hppa,gmane.comp.gdb.patches |
|---|---|
| Message-ID | <[email protected]> |
On 8/3/07, Randolph Chung <[email protected]> wrote: > 2007-08-03 Randolph Chung <[email protected]> > > * hppa-tdep.c (hppa32_cannot_fetch_register) > (hppa64_cannot_fetch_register): New functions. > (hppa_gdbarch_init): Set cannot_fetch_register appropriately. > * hppa-tdep.h (hppa_regnum): Add HPPA_CR26_REGNUM. > > Index: hppa-tdep.c > =================================================================== > RCS file: /cvs/src/src/gdb/hppa-tdep.c,v > retrieving revision 1.234 > diff -u -p -r1.234 hppa-tdep.c > --- hppa-tdep.c 15 Jun 2007 22:44:55 -0000 1.234 > +++ hppa-tdep.c 13 Jul 2007 16:26:29 -0000 > @@ -2676,6 +2676,16 @@ hppa32_cannot_store_register (int regnum > } > > static int > +hppa32_cannot_fetch_register (int regnum) > +{ > + /* cr26 and cr27 are readable (but not writable) from userspace. */ > + if (regnum == HPPA_CR26_REGNUM || regnum == HPPA_CR27_REGNUM) > + return 0; > + else > + return hppa32_cannot_store_register (regnum); > +} > + 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? Cheers, Carlos.