[parisc-linux] [hppa patch] Fix register definitions for hppa

Carlos O'Donell carlos@systemhalted.org
Fri Aug 3 18:42:00 GMT 2007


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.



More information about the Gdb-patches mailing list