aboutsummaryrefslogtreecommitdiff
path: root/gdb
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
parent975531dbc9d5c0de5aaea5127e3be419883eac75 (diff)
downloadgdb-3d468296579d30fe915b067fc21c108033804095.zip
gdb-3d468296579d30fe915b067fc21c108033804095.tar.gz
gdb-3d468296579d30fe915b067fc21c108033804095.tar.bz2
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')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/remote-sim.c34
2 files changed, 21 insertions, 18 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 0333167..abb5449 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2012-10-02 Andrew Burgess <aburgess@broadcom.com>
+
+ * remote-sim.c (dump_mem): Always dump buffer contents, zero fill
+ output and use uint32_t not long to ensure 4 byte size.
+
2012-10-02 Joel Brobecker <brobecker@adacore.com>
* rs6000-nat.c (add_vmap): Set "last" to "next" after having
diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index d87f668..14e989c 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. */