From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12913 invoked by alias); 18 Mar 2010 18:23:50 -0000 Received: (qmail 12877 invoked by uid 22791); 18 Mar 2010 18:23:49 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,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 18:23:42 +0000 Received: from hpaq6.eem.corp.google.com (hpaq6.eem.corp.google.com [10.3.21.6]) by smtp-out.google.com with ESMTP id o2IINdcC000701 for ; Thu, 18 Mar 2010 19:23:39 +0100 Received: from wwg30 (wwg30.prod.google.com [10.241.242.158]) by hpaq6.eem.corp.google.com with ESMTP id o2IINOo5027918 for ; Thu, 18 Mar 2010 19:23:38 +0100 Received: by wwg30 with SMTP id 30so236783wwg.3 for ; Thu, 18 Mar 2010 11:23:38 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.171.145 with SMTP id r17mr1726454wel.182.1268936618154; Thu, 18 Mar 2010 11:23:38 -0700 (PDT) In-Reply-To: <201003181747.29518.pedro@codesourcery.com> References: <20100318173015.6765784413@ruffy.mtv.corp.google.com> <201003181747.29518.pedro@codesourcery.com> Date: Thu, 18 Mar 2010 18:23:00 -0000 Message-ID: Subject: Re: [RFC] Why does ui_out_field_core_addr pad with leading zeroes? From: Doug Evans To: Pedro Alves Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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/msg00679.txt.bz2 On Thu, Mar 18, 2010 at 10:47 AM, Pedro Alves wrot= e: > On Thursday 18 March 2010 17:30:15, Doug Evans wrote: >> I couldn't find an explanation of why ui_out_field_core_addr pads >> the address with leading zeroes. >> >> Does anyone know? > > Personally, I find that zeros on the left serve as > a hint at the largest possible address width in > the architecture. =A0That'd be my educated guess. There are other ways to find that without sacrificing readability. > It also aids visual alignment I suppose. =A0Try also adding > a breakpoint in a shared library in your example, > and redoing `info break'. The column is presently > aligned left. =A0I suspect it won't look as neat after > your patch. I realize that *could* happen, but since we're doing this fancy ui-out thing, I would expect it's the job of the front end to do any desired alignment. For reference sake, this is what I get with my patch: (gdb) b main Breakpoint 2 at 0x40049c: file hello.c, line 6. (gdb) i b Num Type Disp Enb Address What 2 breakpoint keep y 0x40049c in main at hello.c:6 (gdb) b printf Breakpoint 3 at 0x7ffff7acbe40 (gdb) i b Num Type Disp Enb Address What 2 breakpoint keep y 0x40049c in main at hello.c:6 3 breakpoint keep y 0x7ffff7acbe40 (gdb)