Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFC] Why does ui_out_field_core_addr pad with leading zeroes?
@ 2010-03-18 17:30 Doug Evans
  2010-03-18 17:47 ` Pedro Alves
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Doug Evans @ 2010-03-18 17:30 UTC (permalink / raw)
  To: gdb-patches

Hi.

I couldn't find an explanation of *why* ui_out_field_core_addr pads
the address with leading zeroes.

Does anyone know?

2010-03-18  Doug Evans  <dje@google.com>

	* ui-out.c (ui_out_field_core_addr): Don't pad address with leading
	zeroes.

Index: ui-out.c
===================================================================
RCS file: /cvs/src/src/gdb/ui-out.c,v
retrieving revision 1.45
diff -u -p -r1.45 ui-out.c
--- ui-out.c	12 Jan 2010 21:40:24 -0000	1.45
+++ ui-out.c	18 Mar 2010 17:19:07 -0000
@@ -498,12 +498,8 @@ ui_out_field_core_addr (struct ui_out *u
     address &= ((CORE_ADDR) 1 << addr_bit) - 1;
 
   /* FIXME: cagney/2002-05-03: Need local_address_string() function
-     that returns the language localized string formatted to a width
-     based on gdbarch_addr_bit.  */
-  if (addr_bit <= 32)
-    strcpy (addstr, hex_string_custom (address, 8));
-  else
-    strcpy (addstr, hex_string_custom (address, 16));
+     that returns the language localized string.  */
+  strcpy (addstr, hex_string (address));
 
   ui_out_field_string (uiout, fldname, addstr);
 }

E.g.

Before:

(gdb) b main
Breakpoint 1 at 0x40049c: file hello.c, line 6.
(gdb) i b
Num     Type           Disp Enb Address            What
1       breakpoint     keep y   0x000000000040049c in main at hello.c:6
(gdb) 

After:

(gdb) b main
Breakpoint 1 at 0x40049c: file hello.c, line 6.
(gdb) i b
Num     Type           Disp Enb Address            What
1       breakpoint     keep y   0x40049c           in main at hello.c:6
(gdb) 


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2010-03-18 20:59 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-18 17:30 [RFC] Why does ui_out_field_core_addr pad with leading zeroes? Doug Evans
2010-03-18 17:47 ` Pedro Alves
2010-03-18 18:23   ` Doug Evans
2010-03-18 18:58     ` Mark Kettenis
2010-03-18 19:19       ` Doug Evans
2010-03-18 19:25         ` Jan Kratochvil
2010-03-18 19:38           ` Doug Evans
2010-03-18 19:47             ` Pedro Alves
2010-03-18 20:49               ` Doug Evans
2010-03-18 19:51             ` Daniel Jacobowitz
2010-03-18 19:56               ` Pedro Alves
2010-03-18 20:03               ` Mark Kettenis
2010-03-18 20:59               ` Doug Evans
2010-03-18 17:52 ` Joel Brobecker
2010-03-18 18:52 ` Mark Kettenis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox