aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote-sim.c
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@broadcom.com>2012-10-02 21:52:43 +0000
committerAndrew Burgess <aburgess@broadcom.com>2012-10-02 21:52:43 +0000
commit3d468296579d30fe915b067fc21c108033804095 (patch)
treedd736557d0e5e04316a077d85a0303b3ede87536 /gdb/remote-sim.c
parent975531dbc9d5c0de5aaea5127e3be419883eac75 (diff)
http://sourceware.org/ml/gdb-patches/2012-10/msg00027.html
gdb/ChangeLog * remote-sim.c (dump_mem): Always dump buffer contents, zero fill output and use uint32_t not long to ensure 4 byte size.
Diffstat (limited to 'gdb/remote-sim.c')
-rw-r--r--gdb/remote-sim.c34
1 files changed, 16 insertions, 18 deletions
diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index d87f66842b..14e989cd7a 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -273,28 +273,26 @@ sim_inferior_data_cleanup (struct inferior *inf, void *data)
static void
dump_mem (char *buf, int len)
{
- if (len <= 8)
+ printf_filtered ("\t");
+
+ if (len == 8 || len == 4)
{
- if (len == 8 || len == 4)
- {
- long l[2];
+ uint32_t 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
- {
- int i;
+ memcpy (l, buf, len);
+ printf_filtered ("0x%08x", l[0]);
+ if (len == 8)
+ printf_filtered (" 0x%08x", l[1]);
+ }
+ else
+ {
+ int i;
- printf_filtered ("\t");
- for (i = 0; i < len; i++)
- printf_filtered ("0x%x ", buf[i]);
- printf_filtered ("\n");
- }
+ for (i = 0; i < len; i++)
+ printf_filtered ("0x%02x ", buf[i]);
}
+
+ printf_filtered ("\n");
}
/* Initialize gdb_callback. */