From: Jim Blandy <jimb@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: RFA: neaten up sim memory dumping
Date: Mon, 28 Jun 2004 23:58:00 -0000 [thread overview]
Message-ID: <vt21xjzgrqy.fsf@zenia.home> (raw)
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");
}
}
reply other threads:[~2004-06-28 23:58 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=vt21xjzgrqy.fsf@zenia.home \
--to=jimb@redhat.com \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox