Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Carlos O'Donell" <carlos@systemhalted.org>
To: "Randolph Chung" <randolph@tausq.org>
Cc: gdb-patches@sources.redhat.com, parisc-linux@lists.parisc-linux.org
Subject: Re: [parisc-linux] [hppa patch] Fix register definitions for hppa
Date: Fri, 03 Aug 2007 18:42:00 -0000	[thread overview]
Message-ID: <119aab440708031132h58d94c38l672a241301bda9ee@mail.gmail.com> (raw)
In-Reply-To: <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.


  parent reply	other threads:[~2007-08-03 18:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-03 17:06 Randolph Chung
2007-08-03 17:11 ` Daniel Jacobowitz
2007-08-03 18:42 ` Carlos O'Donell [this message]
2007-08-03 20:12   ` [parisc-linux] " Randolph Chung
2007-08-04 16:35     ` Carlos O'Donell
2007-08-04 17:02       ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=119aab440708031132h58d94c38l672a241301bda9ee@mail.gmail.com \
    --to=carlos@systemhalted.org \
    --cc=gdb-patches@sources.redhat.com \
    --cc=parisc-linux@lists.parisc-linux.org \
    --cc=randolph@tausq.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox