Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* RFA: neaten up sim memory dumping
@ 2004-06-28 23:58 Jim Blandy
  0 siblings, 0 replies; only message in thread
From: Jim Blandy @ 2004-06-28 23:58 UTC (permalink / raw)
  To: gdb-patches


Of course, there's no end to the improvements one could make here.
This, at least, improved things enough that I could be sure what was
really going on.

2004-06-28  Jim Blandy  <jimb@redhat.com>

	* remote-sim.c (dump_mem): Include leading zeros in dumped values,
	so the user can tell whether we're dumping words or bytes.  When
	we dump words, interpret them using the target byte order, not
	host byte order.

Index: gdb/remote-sim.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-sim.c,v
retrieving revision 1.39
diff -c -p -r1.39 remote-sim.c
*** gdb/remote-sim.c	25 Jun 2004 19:46:08 -0000	1.39
--- gdb/remote-sim.c	28 Jun 2004 23:56:20 -0000
*************** dump_mem (char *buf, int len)
*** 129,139 ****
      {
        if (len == 8 || len == 4)
  	{
! 	  long l[2];
! 	  memcpy (l, buf, len);
! 	  printf_filtered ("\t0x%lx", l[0]);
  	  if (len == 8)
! 	    printf_filtered (" 0x%lx", l[1]);
  	  printf_filtered ("\n");
  	}
        else
--- 129,140 ----
      {
        if (len == 8 || len == 4)
  	{
! 	  printf_filtered ("\t0x%08lx",
!                            (unsigned long) extract_unsigned_integer (buf, 4));
  	  if (len == 8)
! 	    printf_filtered (" 0x%08lx", 
!                              ((unsigned long)
!                               extract_unsigned_integer (buf + 4, 4)));
  	  printf_filtered ("\n");
  	}
        else
*************** dump_mem (char *buf, int len)
*** 141,147 ****
  	  int i;
  	  printf_filtered ("\t");
  	  for (i = 0; i < len; i++)
! 	    printf_filtered ("0x%x ", buf[i]);
  	  printf_filtered ("\n");
  	}
      }
--- 142,148 ----
  	  int i;
  	  printf_filtered ("\t");
  	  for (i = 0; i < len; i++)
! 	    printf_filtered ("0x%02x ", buf[i]);
  	  printf_filtered ("\n");
  	}
      }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-06-28 23:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-28 23:58 RFA: neaten up sim memory dumping Jim Blandy

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