From: Mike Frysinger <vapier@gentoo.org>
To: gdb-patches@sourceware.org
Cc: "Andrew Burgess" <aburgess@broadcom.com>
Subject: Re: [PATCH] more output from remote-sim dump_mem
Date: Tue, 02 Oct 2012 21:20:00 -0000 [thread overview]
Message-ID: <201210021720.25317.vapier@gentoo.org> (raw)
In-Reply-To: <506B577B.5030306@broadcom.com>
[-- Attachment #1: Type: Text/Plain, Size: 1155 bytes --]
On Tuesday 02 October 2012 17:07:07 Andrew Burgess wrote:
> static void
> dump_mem (char *buf, int len)
> {
> - if (len <= 8)
> + 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 ("\t0x%08x", l[0]);
> + if (len == 8)
> + printf_filtered (" 0x%08x", l[1]);
> + printf_filtered ("\n");
> + }
> + else
> + {
> + int i;
>
> - printf_filtered ("\t");
> - for (i = 0; i < len; i++)
> - printf_filtered ("0x%x ", buf[i]);
> - printf_filtered ("\n");
> - }
> + printf_filtered ("\t");
> + for (i = 0; i < len; i++)
> + printf_filtered ("0x%02x ", buf[i]);
> + printf_filtered ("\n");
> }
> }
you could hoist the \t printf to the top and \n to the bottom and keep the
center focused on the 0x output.
looks OK either way.
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2012-10-02 21:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-02 21:07 Andrew Burgess
2012-10-02 21:20 ` Mike Frysinger [this message]
2012-10-02 21:54 ` Andrew Burgess
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=201210021720.25317.vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=aburgess@broadcom.com \
--cc=gdb-patches@sourceware.org \
/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