From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26276 invoked by alias); 18 Mar 2010 17:30:27 -0000 Received: (qmail 26234 invoked by uid 22791); 18 Mar 2010 17:30:25 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.35) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 18 Mar 2010 17:30:20 +0000 Received: from kpbe18.cbf.corp.google.com (kpbe18.cbf.corp.google.com [172.25.105.82]) by smtp-out.google.com with ESMTP id o2IHUG95024503 for ; Thu, 18 Mar 2010 18:30:17 +0100 Received: from ruffy.mtv.corp.google.com (ruffy.mtv.corp.google.com [172.18.118.116]) by kpbe18.cbf.corp.google.com with ESMTP id o2IHUFt2019667 for ; Thu, 18 Mar 2010 10:30:16 -0700 Received: by ruffy.mtv.corp.google.com (Postfix, from userid 67641) id 6765784413; Thu, 18 Mar 2010 10:30:15 -0700 (PDT) To: gdb-patches@sourceware.org Subject: [RFC] Why does ui_out_field_core_addr pad with leading zeroes? Message-Id: <20100318173015.6765784413@ruffy.mtv.corp.google.com> Date: Thu, 18 Mar 2010 17:30:00 -0000 From: dje@google.com (Doug Evans) X-System-Of-Record: true 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-03/txt/msg00669.txt.bz2 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 * 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)