From: Paul Gilliam <pgilliam@us.ibm.com>
To: gdb-patches@sources.redhat.com
Subject: Re: fix "too much information" bug w/ "info vector" on PowerPC
Date: Wed, 31 Aug 2005 20:30:00 -0000 [thread overview]
Message-ID: <200508311323.15337.pgilliam@us.ibm.com> (raw)
In-Reply-To: <m3psrv14qg.fsf@alligator.red-bean.com>
On Tuesday 30 August 2005 14:42, Jim Blandy wrote:
> - Could you also add comments above the definitions of
> tdep->ppc_vr0_regnum and tdep->ppc_ev0_regnum in ppc-tdep.h?
> Perhaps such comments could have prevented the bugs's appearance in
> the first place.
Here is the new patch with comments added/chanded in ppc-tdep.h
If I hear no objections, I'll commit this tomorrow.
-=# Paul #=-
2005-08-30 Paul Gilliam <pgilliam@us.ibm.com>
* ppc-tdep.h: better explanation of using -1 for nonexistant registers
* rs6000-tdep.c (rs6000_register_reggroup_p): don't assume that
tdep->ppc_vr0_regnum or tdep->ppc_ev0_regnum are not -1
Index: ppc-tdep.h
===================================================================
RCS file: /cvs/src/src/gdb/ppc-tdep.h,v
retrieving revision 1.46
diff -c -3 -p -r1.46 ppc-tdep.h
*** ppc-tdep.h 25 May 2005 03:12:13 -0000 1.46
--- ppc-tdep.h 31 Aug 2005 20:06:35 -0000
*************** struct gdbarch_tdep
*** 152,177 ****
int ppc_ctr_regnum; /* Count register */
int ppc_xer_regnum; /* Integer exception register */
! /* On PPC and RS6000 variants that have no floating-point
! registers, the next two members will be -1. */
int ppc_fp0_regnum; /* floating-point register 0 */
! int ppc_fpscr_regnum; /* Floating point status and condition
! register */
! int ppc_sr0_regnum; /* segment register 0, or -1 on
! variants that have no segment
! registers. */
int ppc_mq_regnum; /* Multiply/Divide extension register */
int ppc_vr0_regnum; /* First AltiVec register */
int ppc_vrsave_regnum; /* Last AltiVec register */
int ppc_ev0_upper_regnum; /* First GPR upper half register */
int ppc_ev0_regnum; /* First ev register */
int ppc_ev31_regnum; /* Last ev register */
int ppc_acc_regnum; /* SPE 'acc' register */
int ppc_spefscr_regnum; /* SPE 'spefscr' register */
! int lr_frame_offset; /* Offset to ABI specific location where
! link register is saved. */
/* An array of integers, such that sim_regno[I] is the simulator
register number for GDB register number I, or -1 if the
--- 152,184 ----
int ppc_ctr_regnum; /* Count register */
int ppc_xer_regnum; /* Integer exception register */
! /* Not all PPC and RS6000 variants will have the registers
! represented below. A -1 is used to indicate that the register
! is not present in this variant. */
!
! /* Floating-point registers. */
int ppc_fp0_regnum; /* floating-point register 0 */
! int ppc_fpscr_regnum; /* fp status and condition register */
! /* Segment registers */
! int ppc_sr0_regnum; /* segment register 0 */
+ /* Used in some older Power architectures. */
int ppc_mq_regnum; /* Multiply/Divide extension register */
+
+ /* Altivec registers */
int ppc_vr0_regnum; /* First AltiVec register */
int ppc_vrsave_regnum; /* Last AltiVec register */
int ppc_ev0_upper_regnum; /* First GPR upper half register */
+
+ /* SPE registers. */
int ppc_ev0_regnum; /* First ev register */
int ppc_ev31_regnum; /* Last ev register */
int ppc_acc_regnum; /* SPE 'acc' register */
int ppc_spefscr_regnum; /* SPE 'spefscr' register */
!
! /* Offset to ABI specific location where link register is saved. */
! int lr_frame_offset;
/* An array of integers, such that sim_regno[I] is the simulator
register number for GDB register number I, or -1 if the
Index: rs6000-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v
retrieving revision 1.241
diff -c -3 -p -r1.241 rs6000-tdep.c
*** rs6000-tdep.c 25 May 2005 03:12:13 -0000 1.241
--- rs6000-tdep.c 31 Aug 2005 20:06:35 -0000
*************** rs6000_register_reggroup_p (struct gdbar
*** 1882,1890 ****
if (group == float_reggroup)
return float_p;
! vector_p = ((regnum >= tdep->ppc_vr0_regnum
&& regnum < tdep->ppc_vr0_regnum + 32)
! || (regnum >= tdep->ppc_ev0_regnum
&& regnum < tdep->ppc_ev0_regnum + 32)
|| regnum == tdep->ppc_vrsave_regnum
|| regnum == tdep->ppc_acc_regnum
--- 1882,1892 ----
if (group == float_reggroup)
return float_p;
! vector_p = ((tdep->ppc_vr0_regnum >= 0
! && regnum >= tdep->ppc_vr0_regnum
&& regnum < tdep->ppc_vr0_regnum + 32)
! || (tdep->ppc_ev0_regnum >= 0
! && regnum >= tdep->ppc_ev0_regnum
&& regnum < tdep->ppc_ev0_regnum + 32)
|| regnum == tdep->ppc_vrsave_regnum
|| regnum == tdep->ppc_acc_regnum
next prev parent reply other threads:[~2005-08-31 20:26 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-30 21:44 Paul Gilliam
2005-08-30 21:46 ` Jim Blandy
2005-08-30 22:24 ` Daniel Jacobowitz
2005-08-30 22:30 ` Jim Blandy
2005-08-30 22:44 ` Daniel Jacobowitz
2005-08-30 23:50 ` Jim Blandy
2005-08-30 22:46 ` Stan Shebs
2005-08-30 23:36 ` Mark Kettenis
2005-08-31 7:52 ` Jim Blandy
2005-08-31 20:30 ` Paul Gilliam [this message]
2005-08-31 20:48 ` Jim Blandy
2005-08-31 20:48 ` Daniel Jacobowitz
2005-09-01 0:30 ` Paul Gilliam
2005-09-01 23:07 ` Jim Blandy
2005-09-02 0:55 ` Daniel Jacobowitz
2005-09-02 14:26 ` Paul Gilliam
2005-09-06 18:14 ` Jim Blandy
2005-09-06 18:21 ` Daniel Jacobowitz
2005-09-01 18:12 ` [commit] " Paul Gilliam
2005-08-31 20:26 ` Kevin Buettner
2005-08-31 20:32 ` Paul Gilliam
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200508311323.15337.pgilliam@us.ibm.com \
--to=pgilliam@us.ibm.com \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox