Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [patch] Don't print saved registers with no name
@ 2003-09-22 16:22 Daniel Jacobowitz
  2003-09-22 16:28 ` Andrew Cagney
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Jacobowitz @ 2003-09-22 16:22 UTC (permalink / raw)
  To: gdb-patches

More cosmetic fallout from the MIPS pseudo-register handling.  Register ""
appeared many times in "info frame".

I'll commit this in a day or two.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

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

	* stack.c (frame_info): Don't print saved registers with no name.

--- stack.c.orig	2003-09-22 12:18:58.000000000 -0400
+++ stack.c	2003-09-22 12:19:42.000000000 -0400
@@ -1079,7 +1079,7 @@
     count = 0;
     numregs = NUM_REGS + NUM_PSEUDO_REGS;
     for (i = 0; i < numregs; i++)
-      if (i != SP_REGNUM)
+      if (REGISTER_NAME (i) && REGISTER_NAME (i)[0] && i != SP_REGNUM)
 	{
 	  /* Find out the location of the saved register without
              fetching the corresponding value.  */


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

* Re: [patch] Don't print saved registers with no name
  2003-09-22 16:22 [patch] Don't print saved registers with no name Daniel Jacobowitz
@ 2003-09-22 16:28 ` Andrew Cagney
  2003-09-23 20:30   ` Daniel Jacobowitz
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Cagney @ 2003-09-22 16:28 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

>      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.

Andrew



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

* Re: [patch] Don't print saved registers with no name
  2003-09-22 16:28 ` Andrew Cagney
@ 2003-09-23 20:30   ` Daniel Jacobowitz
  2003-09-23 21:23     ` Andrew Cagney
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Jacobowitz @ 2003-09-23 20:30 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches

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.  */


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

* Re: [patch] Don't print saved registers with no name
  2003-09-23 20:30   ` Daniel Jacobowitz
@ 2003-09-23 21:23     ` Andrew Cagney
  2003-09-25 16:12       ` Daniel Jacobowitz
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Cagney @ 2003-09-23 21:23 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

> -      if (i != SP_REGNUM)
> +      if (i != SP_REGNUM
> +	  && gdbarch_register_reggroup_p (current_gdbarch, i, all_reggroup))

Yep, thanks.

> [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?]

Don't be too worried about the duplication - SP_REGNUM is going away 
anyway.  However, bug report it so hopefully I can discover that 
eliminating SP eliminated the problem :-)

Andrew



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

* Re: [patch] Don't print saved registers with no name
  2003-09-23 21:23     ` Andrew Cagney
@ 2003-09-25 16:12       ` Daniel Jacobowitz
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Jacobowitz @ 2003-09-25 16:12 UTC (permalink / raw)
  To: gdb-patches

On Tue, Sep 23, 2003 at 05:23:50PM -0400, Andrew Cagney wrote:
> >-      if (i != SP_REGNUM)
> >+      if (i != SP_REGNUM
> >+	  && gdbarch_register_reggroup_p (current_gdbarch, i, all_reggroup))
> 
> Yep, thanks.
> 
> >[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?]
> 
> Don't be too worried about the duplication - SP_REGNUM is going away 
> anyway.  However, bug report it so hopefully I can discover that 
> eliminating SP eliminated the problem :-)

Thanks, done and done.

The astute reader will note that the above does not compile.  Checked
in this instead.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

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

	* stack.c: Include "reggroups.h".
	(frame_info): Only display registers in all_reggroup.
	* Makefile.in (stack.o): Update dependencies.

Index: ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/ChangeLog,v
retrieving revision 1.4799
diff -u -p -r1.4799 ChangeLog
--- ChangeLog	25 Sep 2003 14:20:58 -0000	1.4799
+++ ChangeLog	25 Sep 2003 16:11:23 -0000
@@ -1,3 +1,9 @@
+2003-09-25  Daniel Jacobowitz  <drow@mvista.com>
+
+	* stack.c: Include "reggroups.h".
+	(frame_info): Only display registers in all_reggroup.
+	* Makefile.in (stack.o): Update dependencies.
+
 2003-09-25  Jerome Guitton  <guitton@act-europe.fr>
 
 	* arm-tdep.c (arm_skip_prologue): Handle "sub ip, sp #n" and
Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.447
diff -u -p -r1.447 Makefile.in
--- Makefile.in	25 Sep 2003 09:10:29 -0000	1.447
+++ Makefile.in	25 Sep 2003 16:11:24 -0000
@@ -2342,7 +2342,7 @@ stack.o: stack.c $(defs_h) $(gdb_string_
 	$(gdbtypes_h) $(expression_h) $(language_h) $(frame_h) $(gdbcmd_h) \
 	$(gdbcore_h) $(target_h) $(source_h) $(breakpoint_h) $(demangle_h) \
 	$(inferior_h) $(annotate_h) $(ui_out_h) $(block_h) $(stack_h) \
-	$(gdb_assert_h) $(dictionary_h)
+	$(gdb_assert_h) $(dictionary_h) $(reggroups_h)
 standalone.o: standalone.c $(gdb_stat_h) $(defs_h) $(symtab_h) $(frame_h) \
 	$(inferior_h) $(gdb_wait_h)
 std-regs.o: std-regs.c $(defs_h) $(user_regs_h) $(frame_h) $(gdbtypes_h) \
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	25 Sep 2003 16:11:27 -0000
@@ -43,6 +43,7 @@
 #include "stack.h"
 #include "gdb_assert.h"
 #include "dictionary.h"
+#include "reggroups.h"
 
 /* Prototypes for exported functions. */
 
@@ -1079,7 +1080,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.  */


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

end of thread, other threads:[~2003-09-25 16:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-22 16:22 [patch] Don't print saved registers with no name Daniel Jacobowitz
2003-09-22 16:28 ` Andrew Cagney
2003-09-23 20:30   ` Daniel Jacobowitz
2003-09-23 21:23     ` Andrew Cagney
2003-09-25 16:12       ` Daniel Jacobowitz

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