From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18299 invoked by alias); 14 Oct 2005 19:11: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 18282 invoked by uid 22791); 14 Oct 2005 19:11:43 -0000 Received: from e33.co.us.ibm.com (HELO e33.co.us.ibm.com) (32.97.110.151) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Fri, 14 Oct 2005 19:11:43 +0000 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e33.co.us.ibm.com (8.12.11/8.12.11) with ESMTP id j9EJ9pVw025238 for ; Fri, 14 Oct 2005 15:09:51 -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 j9EJBfkF495574 for ; Fri, 14 Oct 2005 13:11:41 -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 j9EJBfG1014128 for ; Fri, 14 Oct 2005 13:11:41 -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 j9EJBfVm014090 for ; Fri, 14 Oct 2005 13:11:41 -0600 From: Paul Gilliam Reply-To: pgilliam@us.ibm.com To: gdb-patches@sources.redhat.com Subject: [PATCH] Add vscr register to 'list' of PowerPC vector registers. Date: Fri, 14 Oct 2005 19:11:00 -0000 User-Agent: KMail/1.6.2 MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <200510141213.20387.pgilliam@us.ibm.com> X-SW-Source: 2005-10/txt/msg00123.txt.bz2 The vscr regisgter was omitted from the if statement in rs6000-tdep.c that decides if a register is a vector register. Consiquetly, it was not printed along with the other vector registers using the 'info vector' command. Two patches follow: the first fixes the problem with the least amount of fuss. The second adds ppc_vscr_regnum to the gdbarch_tdep struct in ppc-tdep.h and then uses that. This version was prompted by this comment in rs6000-tdep.c: /* FIXME: jimb/2004-07-15: when we have tdep->ppc_vscr_regnum, we can treat this more like the other cases. */ Which should i commit? ---------------------------- take one---------------------------- 2005-10-14 Paul Gilliam * rs6000-tdep.c (rs6000_register_reggroup_p): Add vscr to test for vector registers. Index: rs6000-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v retrieving revision 1.245 diff -r1.245 rs6000-tdep.c 1890a1891 > || regnum == tdep->ppc_vrsave_regnum - 1 /* vscr */ ---------------------------- take two---------------------------- 2005-10-14 Paul Gilliam * ppc-tdep.c (struct gdbarch_tdep): Add ppc_vsr_regnum. * rs6000-tdep.c (init_sim_regno_table, rs6000_register_reggroup_p, rs6000_stab_reg_to_regnum, rs6000_dwarf2_reg_to_regnum): Use new ppc_vscr_regnum. (rs6000_gdbarch_init): Initialize ppc_vscr_regnum. Index: ppc-tdep.h =================================================================== RCS file: /cvs/src/src/gdb/ppc-tdep.h,v retrieving revision 1.47 diff -r1.47 ppc-tdep.h 170a171 > int ppc_vscr_regnum; /* Second to last AltiVec register */ Index: rs6000-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v retrieving revision 1.245 diff -r1.245 rs6000-tdep.c 264,265d263 < /* FIXME: jimb/2004-07-15: when we have tdep->ppc_vscr_regnum, < we can treat this more like the other cases. */ 267c265 < tdep->ppc_vr0_regnum + ppc_num_vrs, --- > tdep->ppc_vscr_regnum, 1890a1889 > || regnum == tdep->ppc_vscr_regnum 2106c2105 < return tdep->ppc_vrsave_regnum - 1; /* vscr */ --- > return tdep->ppc_vscr_regnum; 2138c2137 < return tdep->ppc_vrsave_regnum - 1; /* vscr */ --- > return tdep->ppc_vscr_regnum; 3243a3243 > tdep->ppc_vscr_regnum = 103; 3247a3248 > tdep->ppc_vscr_regnum = 151;