This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [parisc-linux] [hppa patch] Fix register definitions for hppa
- From: "Carlos O'Donell" <carlos at systemhalted dot org>
- To: "Randolph Chung" <randolph at tausq dot org>
- Cc: gdb-patches at sources dot redhat dot com, parisc-linux at lists dot parisc-linux dot org
- Date: Fri, 3 Aug 2007 14:32:41 -0400
- Subject: Re: [parisc-linux] [hppa patch] Fix register definitions for hppa
- References: <20070803170646.GB32611@tausq.org>
On 8/3/07, Randolph Chung <randolph@tausq.org> wrote:
> 2007-08-03 Randolph Chung <tausq@debian.org>
>
> * 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.