* Missing 0x in phex_nz output
@ 2010-04-01 22:42 H.J. Lu
2010-04-01 22:50 ` Stan Shebs
2010-04-01 22:51 ` Pedro Alves
0 siblings, 2 replies; 6+ messages in thread
From: H.J. Lu @ 2010-04-01 22:42 UTC (permalink / raw)
To: GDB
Hi,
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));
scm-valprint.c: fprintf_filtered (stream, " #X%s>", phex_nz
(svalue, SCM_SIZE));
There may be more cases like the above.
--
H.J.
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: Missing 0x in phex_nz output 2010-04-01 22:42 Missing 0x in phex_nz output H.J. Lu @ 2010-04-01 22:50 ` Stan Shebs 2010-04-01 22:51 ` Pedro Alves 1 sibling, 0 replies; 6+ messages in thread From: Stan Shebs @ 2010-04-01 22:50 UTC (permalink / raw) To: H.J. Lu; +Cc: GDB H.J. Lu wrote: > Hi, > > 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)); > All these cases are ones in which interface protocol prescribes that the values be hexadecimal, but with no qualifying prefix. Stan ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Missing 0x in phex_nz output 2010-04-01 22:42 Missing 0x in phex_nz output H.J. Lu 2010-04-01 22:50 ` Stan Shebs @ 2010-04-01 22:51 ` Pedro Alves 2010-04-01 22:54 ` H.J. Lu 1 sibling, 1 reply; 6+ messages in thread From: Pedro Alves @ 2010-04-01 22:51 UTC (permalink / raw) To: gdb-patches; +Cc: H.J. Lu 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. -- Pedro Alves ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Missing 0x in phex_nz output 2010-04-01 22:51 ` Pedro Alves @ 2010-04-01 22:54 ` H.J. Lu 2010-04-01 23:04 ` Pedro Alves 0 siblings, 1 reply; 6+ messages in thread From: H.J. Lu @ 2010-04-01 22:54 UTC (permalink / raw) To: Pedro Alves; +Cc: gdb-patches 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); ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Missing 0x in phex_nz output 2010-04-01 22:54 ` H.J. Lu @ 2010-04-01 23:04 ` Pedro Alves 2010-04-01 23:13 ` H.J. Lu 0 siblings, 1 reply; 6+ messages in thread From: Pedro Alves @ 2010-04-01 23:04 UTC (permalink / raw) To: H.J. Lu; +Cc: gdb-patches On Thursday 01 April 2010 23:54:30, H.J. Lu wrote: > How about this one? > Use hex_string instead of adding the "0x"; it does that for you. Preaproved with that change. > > -- > 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); -- Pedro Alves ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Missing 0x in phex_nz output 2010-04-01 23:04 ` Pedro Alves @ 2010-04-01 23:13 ` H.J. Lu 0 siblings, 0 replies; 6+ messages in thread From: H.J. Lu @ 2010-04-01 23:13 UTC (permalink / raw) To: Pedro Alves; +Cc: gdb-patches On Thu, Apr 1, 2010 at 4:04 PM, Pedro Alves <pedro@codesourcery.com> wrote: > On Thursday 01 April 2010 23:54:30, H.J. Lu wrote: >> How about this one? >> > > Use hex_string instead of adding the "0x"; it does > that for you. Preaproved with that change. Done. Thanks. H.J. --- >> >> -- >> 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); > > > -- > Pedro Alves > -- H.J. ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-04-01 23:13 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2010-04-01 22:42 Missing 0x in phex_nz output H.J. Lu 2010-04-01 22:50 ` Stan Shebs 2010-04-01 22:51 ` Pedro Alves 2010-04-01 22:54 ` H.J. Lu 2010-04-01 23:04 ` Pedro Alves 2010-04-01 23:13 ` H.J. Lu
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox