This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Missing 0x in phex_nz output


On Thu, Apr 1, 2010 at 3:51 PM, Pedro Alves <pedro@codesourcery.com> 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 outputs:
>>
>> m32r-rom.c: ? ? ?monitor_printf ("%s mw\r", phex_nz (section_base, addr_size));
>> monitor.c: ? ? ?monitor_printf ("%s\r", phex_nz (val, reg_size));
>> monitor.c: ? ? ?monitor_printf ("%s\r", phex_nz (val, reg_size));
>> remote.c: ?xsnprintf (buf, get_remote_packet_size (), "P%s=", phex_nz
>> (reg->pnum, 0));
>> remote.c: ? ? ?sprintf (p, "pc:%s", phex_nz (addr1, 0));
>> remote.c: ? ? ?sprintf (p, "range:%s:%s", phex_nz (addr1, 0), phex_nz
>> (addr2, 0));
>> remote.c: ? ? ?sprintf (p, "outside:%s:%s", phex_nz (addr1, 0),
>> phex_nz (addr2, 0));
>
> These all are building remote|monitor protocol strings, not user
> visible output. ?It's a protocol requirement that they don't have
> the 0x prefix.
>
>> scm-valprint.c: ? ? ? 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?


-- 
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 == 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);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]