From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30777 invoked by alias); 3 Aug 2007 20:12:24 -0000 Received: (qmail 30769 invoked by uid 22791); 3 Aug 2007 20:12:23 -0000 X-Spam-Check-By: sourceware.org Received: from gandalf.tausq.org (HELO arwen.tausq.org) (64.81.244.94) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 03 Aug 2007 20:12:21 +0000 Received: by arwen.tausq.org (Postfix, from userid 1000) id A0B4743879; Fri, 3 Aug 2007 13:12:19 -0700 (PDT) Date: Fri, 03 Aug 2007 20:12:00 -0000 From: Randolph Chung To: Carlos O'Donell Cc: gdb-patches@sources.redhat.com, parisc-linux@lists.parisc-linux.org Subject: Re: [parisc-linux] [hppa patch] Fix register definitions for hppa Message-ID: <20070803201219.GC32611@tausq.org> Reply-To: Randolph Chung References: <20070803170646.GB32611@tausq.org> <119aab440708031132h58d94c38l672a241301bda9ee@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <119aab440708031132h58d94c38l672a241301bda9ee@mail.gmail.com> X-GPG: for GPG key, see http://www.tausq.org/gpg.txt User-Agent: Mutt/1.5.6+20040722i 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/msg00077.txt.bz2 > 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? Remember that gdb is reading the cr27 of the debuggee, not of itself, so __set_cr27 is irrelevant. From the architecture point of view, CR26 and CR27 are only readable from userspace, so gdb should not enable somebody to set them from inside gdb. GDB gets the value of cr26/cr27 the same way it gets the value of other registers -- via ptrace or the register set returned in a core dump, etc... randolph -- Randolph Chung Debian GNU/Linux Developer, hppa/ia64 ports http://www.tausq.org/