Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* fix "too much information" bug w/ "info vector" on PowerPC
@ 2005-08-30 21:44 Paul Gilliam
  2005-08-30 21:46 ` Jim Blandy
  2005-08-31 20:26 ` Kevin Buettner
  0 siblings, 2 replies; 21+ messages in thread
From: Paul Gilliam @ 2005-08-30 21:44 UTC (permalink / raw)
  To: gdb-patches

Here is the problem:  When I do 'info vector', I get ALL the registers, not just the vector registers.
This happens because a test is made to see if a given register is in the vector group.   The test
compares the incoming register number against appropriate register numbers from tdep, ignoring
the fact that if, for example, there are no ev registers, the value of tdep->ppc_ev0_regnum will be
-1.  Same thing for tdep->ppc_vr0_regnum.

I was temped to commit this is obvious, but wanted the warm fuzzy of peer review.

-=# Paul #=-

2005-08-30  Paul Gilliam <pgilliam@us.ibm.com>

	* rs6000-tdep.c (rs6000_register_reggroup_p): don't assume that
        tdep->ppc_vr0_regnum or tdep->ppc_ev0_regnum are not -1


Index: rs6000-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v
retrieving revision 1.241
diff -3 -c -p -r1.241 rs6000-tdep.c
*** rs6000-tdep.c       25 May 2005 03:12:13 -0000      1.241
--- rs6000-tdep.c       30 Aug 2005 21:07:25 -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


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2005-09-06 18:21 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-30 21:44 fix "too much information" bug w/ "info vector" on PowerPC 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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox