From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15278 invoked by alias); 3 Aug 2007 18:42:48 -0000 Received: (qmail 15268 invoked by uid 22791); 3 Aug 2007 18:42:47 -0000 X-Spam-Check-By: sourceware.org Received: from rv-out-0910.google.com (HELO rv-out-0910.google.com) (209.85.198.189) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 03 Aug 2007 18:42:43 +0000 Received: by rv-out-0910.google.com with SMTP id l15so648623rvb for ; Fri, 03 Aug 2007 11:42:41 -0700 (PDT) Received: by 10.114.198.1 with SMTP id v1mr3236883waf.1186165961158; Fri, 03 Aug 2007 11:32:41 -0700 (PDT) Received: by 10.114.111.7 with HTTP; Fri, 3 Aug 2007 11:32:41 -0700 (PDT) Message-ID: <119aab440708031132h58d94c38l672a241301bda9ee@mail.gmail.com> Date: Fri, 03 Aug 2007 18:42:00 -0000 From: "Carlos O'Donell" To: "Randolph Chung" Subject: Re: [parisc-linux] [hppa patch] Fix register definitions for hppa Cc: gdb-patches@sources.redhat.com, parisc-linux@lists.parisc-linux.org In-Reply-To: <20070803170646.GB32611@tausq.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20070803170646.GB32611@tausq.org> X-Google-Sender-Auth: ea72f02269ce7aaa Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-08/txt/msg00070.txt.bz2 On 8/3/07, Randolph Chung wrote: > 2007-08-03 Randolph Chung > > * 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.