This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] Add vscr register to 'list' of PowerPC vector registers.
- From: Paul Gilliam <pgilliam at us dot ibm dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Fri, 14 Oct 2005 12:13:20 -0700
- Subject: [PATCH] Add vscr register to 'list' of PowerPC vector registers.
- Reply-to: pgilliam at us dot ibm dot com
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 <pgilliam@us.ibm.com>
* 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 <pgilliam@us.ibm.com>
* 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;