From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10916 invoked by alias); 17 Oct 2005 20:31:53 -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 10908 invoked by uid 22791); 17 Oct 2005 20:31:51 -0000 Received: from e36.co.us.ibm.com (HELO e36.co.us.ibm.com) (32.97.110.154) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 17 Oct 2005 20:31:51 +0000 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e36.co.us.ibm.com (8.12.11/8.12.11) with ESMTP id j9HKU7wL016283 for ; Mon, 17 Oct 2005 16:30:07 -0400 Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VERS6.7) with ESMTP id j9HKVnhK540010 for ; Mon, 17 Oct 2005 14:31:49 -0600 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.12.11/8.13.3) with ESMTP id j9HKVmoV016393 for ; Mon, 17 Oct 2005 14:31:48 -0600 Received: from dyn9047022123-009047022095.beaverton.ibm.com (dyn9047022123-009047022095.beaverton.ibm.com [9.47.22.95]) by d03av01.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j9HKVm7O016371 for ; Mon, 17 Oct 2005 14:31:48 -0600 From: Paul Gilliam Reply-To: pgilliam@us.ibm.com Subject: [PATCH] allow gdb to access altivec registers Date: Mon, 17 Oct 2005 20:31:00 -0000 User-Agent: KMail/1.6.2 MIME-Version: 1.0 Content-Disposition: inline To: gdb-patches@sources.redhat.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <200510171332.13857.pgilliam@us.ibm.com> X-SW-Source: 2005-10/txt/msg00139.txt.bz2 In rs6000-tdep.c (rs6000_gdbarch_init), bfd_mach_ppc64 is assumed to NOT have altivec registers. This patch makes it assume that it does. This works for machines with the IBM PowerPC 970 chip, an IBM JS-20 or Apple G5 for example. If the bfd_mach_ppc64 should happen to NOT have an altivec unit, the ptrace to get the vector registers will fail the first time it's called and it will never be called again. Here's the patch: 2005-10-17 Paul Gilliam * rs6000-tdep.c (rs6000_gdbarch_init): Assume that bfd_mach_ppc64 has altivec unit, just like bfd_mach_ppc. Index: rs6000-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v retrieving revision 1.246 diff -a -u -p -r1.246 rs6000-tdep.c --- rs6000-tdep.c 14 Oct 2005 20:17:11 -0000 1.246 +++ rs6000-tdep.c 17 Oct 2005 20:16:51 -0000 @@ -3240,6 +3240,7 @@ rs6000_gdbarch_init (struct gdbarch_info switch (v->mach) { case bfd_mach_ppc: + case bfd_mach_ppc64: tdep->ppc_sr0_regnum = -1; tdep->ppc_vr0_regnum = 71; tdep->ppc_vrsave_regnum = 104; @@ -3263,7 +3264,6 @@ rs6000_gdbarch_init (struct gdbarch_info set_gdbarch_register_reggroup_p (gdbarch, e500_register_reggroup_p); break; - case bfd_mach_ppc64: case bfd_mach_ppc_620: case bfd_mach_ppc_630: case bfd_mach_ppc_a35: