From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6316 invoked by alias); 1 Apr 2010 22:54:40 -0000 Received: (qmail 6288 invoked by uid 22791); 1 Apr 2010 22:54:39 -0000 X-SWARE-Spam-Status: No, hits=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SARE_MSGID_LONG45,TW_XS X-Spam-Check-By: sourceware.org Received: from mail-vw0-f41.google.com (HELO mail-vw0-f41.google.com) (209.85.212.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 01 Apr 2010 22:54:34 +0000 Received: by vws4 with SMTP id 4so962617vws.0 for ; Thu, 01 Apr 2010 15:54:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.90.201 with HTTP; Thu, 1 Apr 2010 15:54:30 -0700 (PDT) In-Reply-To: <201004012351.20183.pedro@codesourcery.com> References: <201004012351.20183.pedro@codesourcery.com> Date: Thu, 01 Apr 2010 22:54:00 -0000 Received: by 10.220.122.28 with SMTP id j28mr789665vcr.167.1270162470993; Thu, 01 Apr 2010 15:54:30 -0700 (PDT) Message-ID: Subject: Re: Missing 0x in phex_nz output From: "H.J. Lu" To: Pedro Alves Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: 2010-04/txt/msg00033.txt.bz2 On Thu, Apr 1, 2010 at 3:51 PM, Pedro Alves wrote: > On Thursday 01 April 2010 23:42:13, H.J. Lu wrote: >> phex_nz returns a string of hex number. But 0x is missing in many output= s: >> >> m32r-rom.c: =A0 =A0 =A0monitor_printf ("%s mw\r", phex_nz (section_base,= addr_size)); >> monitor.c: =A0 =A0 =A0monitor_printf ("%s\r", phex_nz (val, reg_size)); >> monitor.c: =A0 =A0 =A0monitor_printf ("%s\r", phex_nz (val, reg_size)); >> remote.c: =A0xsnprintf (buf, get_remote_packet_size (), "P%s=3D", phex_nz >> (reg->pnum, 0)); >> remote.c: =A0 =A0 =A0sprintf (p, "pc:%s", phex_nz (addr1, 0)); >> remote.c: =A0 =A0 =A0sprintf (p, "range:%s:%s", phex_nz (addr1, 0), phex= _nz >> (addr2, 0)); >> remote.c: =A0 =A0 =A0sprintf (p, "outside:%s:%s", phex_nz (addr1, 0), >> phex_nz (addr2, 0)); > > These all are building remote|monitor protocol strings, not user > visible output. =A0It's a protocol requirement that they don't have > the 0x prefix. > >> scm-valprint.c: =A0 =A0 =A0 fprintf_filtered (stream, " #X%s>", phex_nz >> (svalue, SCM_SIZE)); > > No idea what this is, but I bet the #X prefix has some "hex" > meaning already. > How about this one? --=20 H.J. diff --git a/gdb/remote.c b/gdb/remote.c index 395a56d..bb80afb 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -4882,7 +4882,7 @@ Packet: '%s'\n"), ++p; if (reg =3D=3D NULL) - error (_("Remote sent bad register number %s: %s\n\ + error (_("Remote sent bad register number 0x%s: %s\n\ Packet: '%s'\n"), phex_nz (pnum, 0), p, buf);