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: [RFC] Why does ui_out_field_core_addr pad with leading zeroes?


On Thu, Mar 18, 2010 at 11:55 AM, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
>> Date: Thu, 18 Mar 2010 11:23:38 -0700
>> From: Doug Evans <dje@google.com>
>>
>> > It also aids visual alignment I suppose. ?Try also adding
>> > a breakpoint in a shared library in your example,
>> > and redoing `info break'. The column is presently
>> > aligned left. ?I 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 ? ? <printf>
>> (gdb)
>
> So since the CLI obviously doesn't align the unpadded addresses
> properly, I'd say your diff shouldn't go in until it does.

I'm not sure I understand.  Clearly there is some alignment going on
otherwise the "What" column would be all messed up, but it is not.
I'm going to assume you're saying that the proper alignment would be
to right-justify the addresses.  Correct me if this assumption is
wrong.

Having stared at both alignments, I don't see aligning the address to
the right as being easier to read than aligning them to the left, and
even less so.

Right Aligned

(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 <printf>
(gdb)

Left Aligned

(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     <printf>
(gdb)

Did you have something else in mind?


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