From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2085 invoked by alias); 11 Apr 2002 19:25:47 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 2075 invoked from network); 11 Apr 2002 19:25:44 -0000 Received: from unknown (HELO nevyn.them.org) (128.2.145.6) by sources.redhat.com with SMTP; 11 Apr 2002 19:25:44 -0000 Received: from drow by nevyn.them.org with local (Exim 3.35 #1 (Debian)) id 16vkCh-0004Dc-00 for ; Thu, 11 Apr 2002 15:25:55 -0400 Date: Thu, 11 Apr 2002 12:25:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sources.redhat.com Subject: Re: [PATCH] Add support for fpscr for Power / PowerPC targets Message-ID: <20020411152555.A16075@nevyn.them.org> Mail-Followup-To: gdb-patches@sources.redhat.com References: <1020411191706.ZM3109@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1020411191706.ZM3109@localhost.localdomain> User-Agent: Mutt/1.3.23i X-SW-Source: 2002-04/txt/msg00425.txt.bz2 On Thu, Apr 11, 2002 at 12:17:06PM -0700, Kevin Buettner wrote: > I've just committed the patch below. It adds support for the fpscr > register for Power and PowerPC targets. I've tested this patch on > GNU/Linux/PPC (native). > > For PowerPC, the fpscr regnum is 70, which was an unused slot. For > Power, I chose to use the first available slot (71). The other change > that this patch makes is to make MQ unavailable for all PowerPC > targets except for the 601 processors (which is as it should be). > > * ppc-tdep.h (struct gdbarch_tdep): Add new field ``ppc_fpscr_regnum''. > * ppc-bdm.c (bdm_ppc_fetch_registers, bdm_ppc_store_registers): > Add fpscr as an invalid/unfetchable register. > * ppc-linux-nat.c (ppc_register_u_addr, store_register) > (fetch_ppc_registers, store_ppc_registers, supply_fpregset) > (fill_fpregset): Add support for register fpscr. > (fetch_ppc_registers, store_ppc_registers, supply_gregset) > (fill_gregset): Account for the fact that register ``mq'' might > not exist. > * rs6000-tdep.c (PPC_UISA_SPRS): Use (unused) slot 70 for fpscr. > (registers_power): Add fpscr to register set at slot 71. > (rs6000_gdbarch_init): Account for the fact that ``mq'' doesn't > exist on most PPC architectures. Initialize ppc_fpscr_regnum. I know this is not adequately documented right now, but every change to the format of the register cache is a change to the remote protocol. The closest thing we've got to documentation are the files in regformats/; they don't document a fraction of the possibilities, though. I've updated the PowerPC definition to match this change, as well as updating gdbserver. Before I commit either, though: > @@ -376,6 +380,14 @@ store_register (int tid, int regno) > ptrace (PT_WRITE_U, tid, (PTRACE_ARG3_TYPE) regaddr, > *(PTRACE_XFER_TYPE *) & buf[i]); > regaddr += sizeof (PTRACE_XFER_TYPE); > + > + if (errno == EIO > + && regno == gdbarch_tdep (current_gdbarch)->ppc_fpscr_regnum) > + { > + /* Some older kernel versions don't allow fpscr to be written. */ > + continue; > + } > + > if (errno != 0) > { > sprintf (mess, "writing register %s (#%d)", What versions are we talking here? Is it worth silencing the gdbserver warning in this case? -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer