From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10573 invoked by alias); 2 Oct 2012 21:20:32 -0000 Received: (qmail 10564 invoked by uid 22791); 2 Oct 2012 21:20:31 -0000 X-SWARE-Spam-Status: No, hits=-9.6 required=5.0 tests=AWL,BAYES_00,KHOP_PGP_SIGNED,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,TW_CP X-Spam-Check-By: sourceware.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 02 Oct 2012 21:20:25 +0000 Received: from vapier.localnet (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 050AF33C206; Tue, 2 Oct 2012 21:20:25 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: Re: [PATCH] more output from remote-sim dump_mem Date: Tue, 02 Oct 2012 21:20:00 -0000 User-Agent: KMail/1.13.7 (Linux/3.5.2; KDE/4.6.5; x86_64; ; ) Cc: "Andrew Burgess" References: <506B577B.5030306@broadcom.com> In-Reply-To: <506B577B.5030306@broadcom.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart4233262.msS8SbsLhC"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <201210021720.25317.vapier@gentoo.org> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-10/txt/msg00028.txt.bz2 --nextPart4233262.msS8SbsLhC Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-length: 1145 On Tuesday 02 October 2012 17:07:07 Andrew Burgess wrote: > static void > dump_mem (char *buf, int len) > { > - if (len <=3D 8) > + if (len =3D=3D 8 || len =3D=3D 4) > { > - if (len =3D=3D 8 || len =3D=3D 4) > - { > - long l[2]; > + uint32_t l[2]; >=20 > - memcpy (l, buf, len); > - printf_filtered ("\t0x%lx", l[0]); > - if (len =3D=3D 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 =3D=3D 8) > + printf_filtered (" 0x%08x", l[1]); > + printf_filtered ("\n"); > + } > + else > + { > + int i; >=20 > - printf_filtered ("\t"); > - for (i =3D 0; i < len; i++) > - printf_filtered ("0x%x ", buf[i]); > - printf_filtered ("\n"); > - } > + printf_filtered ("\t"); > + for (i =3D 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= =20 center focused on the 0x output. looks OK either way. -mike --nextPart4233262.msS8SbsLhC Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. Content-length: 836 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (GNU/Linux) iQIcBAABAgAGBQJQa1qZAAoJEEFjO5/oN/WBiPYQAIPZLVPQdC4QLvI4leXZ1M/2 wFjvCgNl4n6L8ZD1YDkLa6HzZERyi1cnsM77x3u/hGIDqZ65lfMxFZL0YCnrUz6r g0/ULVJYFw0u86/RiHybXKF4odu5DWFiLW/uhWlxSzemt3WL5Ed/GKSIelXb6lKj oTwHFFTafX3kbf9sF0skJSsu7b6ljmkeCe6Q3OwrsKHY1YCdNwZWHkySxMDtqFov JGUVYtP5L8xtKXfQVrcmX/wpHef79cYDzxax9a07JAWV5+EsQORaAXSCaSPDKxwK uO9qePqKdUGsys/I1fhrGsgKZPRO318XdU3132BgZeC/z5BNQff4U+oUDUOFWBe/ W10TbWAsw5qHFkKyxcquxQ/ZAT1g2939wdFwvQQnX1xvykX+C5+I/CgKUkaLtq4p UI1SFEAh/dGp+CM+Z32EuYa5H+yAAvk82VecwIyumuoIY5XR4imUrX9jfm4u74ba zHuWEHvj1bFTaLhEfKID9LC9VuBrm9P08QuOSwYDUuVu4vmj6YctMMqedbgWxg3B VhpIovBTZe4iFBgKVp1BYcKhagmSNfHlWhZ46r09QqxM5dz2/Tt+GE1pHyb6/4l/ WTXDRPzyFp1S8MoUnZnn6FNbuapQVBp9p09sDBZ7OHasZDoRnGCLZNt3qbFtn6rs 5o/kiOy1n4A6MsbfVgvI =AD7u -----END PGP SIGNATURE----- --nextPart4233262.msS8SbsLhC--