This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Don't print saved registers with no name


On Mon, Sep 22, 2003 at 12:28:42PM -0400, Andrew Cagney wrote:
> >     for (i = 0; i < numregs; i++)
> >-      if (i != SP_REGNUM)
> >+      if (REGISTER_NAME (i) && REGISTER_NAME (i)[0] && i != SP_REGNUM)
> > 	{
> 
> That should be changed to use a reggroup iterator.

We only seem to have an iterator for iterating over a list of
reggroups, not for finding the members of a reggroup.  I figure this is
what you meant?

[Both patches display sp an extra time.  I don't see a way around it,
with this code the way it is... does anyone else?]

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

2003-09-23  Daniel Jacobowitz  <drow@mvista.com>

	* stack.c (frame_info): Only display registers in all_reggroup.

Index: stack.c
===================================================================
RCS file: /cvs/src/src/gdb/stack.c,v
retrieving revision 1.87
diff -u -p -r1.87 stack.c
--- stack.c	21 Sep 2003 01:26:45 -0000	1.87
+++ stack.c	23 Sep 2003 20:25:56 -0000
@@ -1079,7 +1079,8 @@ frame_info (char *addr_exp, int from_tty
     count = 0;
     numregs = NUM_REGS + NUM_PSEUDO_REGS;
     for (i = 0; i < numregs; i++)
-      if (i != SP_REGNUM)
+      if (i != SP_REGNUM
+	  && gdbarch_register_reggroup_p (current_gdbarch, i, all_reggroup))
 	{
 	  /* Find out the location of the saved register without
              fetching the corresponding value.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]