* RFA: tidy note columns
@ 2011-04-21 17:07 Tom Tromey
2011-04-21 19:47 ` Tom Tromey
0 siblings, 1 reply; 4+ messages in thread
From: Tom Tromey @ 2011-04-21 17:07 UTC (permalink / raw)
To: Binutils Development
Right now, `readelf -n' columns don't always align nicely:
Owner Data size Description
stapsdt 0x0000002e Unknown note type: (0x00000003)
This patch makes them tidier. I chose this particular implementation
approach because it makes it simpler to change the column widths in the
future.
Ok?
Tom
2011-04-21 Tom Tromey <tromey@redhat.com>
* readelf.c (process_corefile_note_segment): Change header field
widths.
(process_note): Change field widths.
Index: readelf.c
===================================================================
RCS file: /cvs/src/src/binutils/readelf.c,v
retrieving revision 1.540
diff -u -r1.540 readelf.c
--- readelf.c 7 Apr 2011 11:40:12 -0000 1.540
+++ readelf.c 21 Apr 2011 17:03:37 -0000
@@ -12444,7 +12444,7 @@
note type strings. */
nt = get_note_type (pnote->type);
- printf (" %-10s\t0x%08lx\t%s\n", name, pnote->descsz, nt);
+ printf (" %-20s 0x%08lx\t%s\n", name, pnote->descsz, nt);
if (const_strneq (pnote->namedata, "IPF/VMS"))
return print_ia64_vms_note (pnote);
@@ -12472,7 +12472,7 @@
printf (_("\nNotes at offset 0x%08lx with length 0x%08lx:\n"),
(unsigned long) offset, (unsigned long) length);
- printf (_(" Owner\t\tData size\tDescription\n"));
+ printf (_(" %-20s %10s\tDescription\n"), _("Offset"), _("Data size"));
while (external < (Elf_External_Note *) ((char *) pnotes + length))
{
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: RFA: tidy note columns
2011-04-21 17:07 RFA: tidy note columns Tom Tromey
@ 2011-04-21 19:47 ` Tom Tromey
2011-04-25 23:02 ` Alan Modra
0 siblings, 1 reply; 4+ messages in thread
From: Tom Tromey @ 2011-04-21 19:47 UTC (permalink / raw)
To: Binutils Development
>>>>> "Tom" == Tom Tromey <tromey@redhat.com> writes:
Tom> Ok?
Tom> - printf (_(" Owner\t\tData size\tDescription\n"));
Tom> + printf (_(" %-20s %10s\tDescription\n"), _("Offset"), _("Data size"));
Let's just pretend I didn't mysteriously s/Owner/Offset/ here.
Tom
2011-04-21 Tom Tromey <tromey@redhat.com>
* readelf.c (process_corefile_note_segment): Change header field
widths.
(process_note): Change field widths.
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 7ac9914..e94657d 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -12444,7 +12444,7 @@ process_note (Elf_Internal_Note * pnote)
note type strings. */
nt = get_note_type (pnote->type);
- printf (" %-10s\t0x%08lx\t%s\n", name, pnote->descsz, nt);
+ printf (" %-20s 0x%08lx\t%s\n", name, pnote->descsz, nt);
if (const_strneq (pnote->namedata, "IPF/VMS"))
return print_ia64_vms_note (pnote);
@@ -12472,7 +12472,7 @@ process_corefile_note_segment (FILE * file, bfd_vma offset, bfd_vma length)
printf (_("\nNotes at offset 0x%08lx with length 0x%08lx:\n"),
(unsigned long) offset, (unsigned long) length);
- printf (_(" Owner\t\tData size\tDescription\n"));
+ printf (_(" %-20s %10s\tDescription\n"), _("Owner"), _("Data size"));
while (external < (Elf_External_Note *) ((char *) pnotes + length))
{
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: RFA: tidy note columns
2011-04-21 19:47 ` Tom Tromey
@ 2011-04-25 23:02 ` Alan Modra
2011-04-26 13:18 ` Tom Tromey
0 siblings, 1 reply; 4+ messages in thread
From: Alan Modra @ 2011-04-25 23:02 UTC (permalink / raw)
To: Tom Tromey; +Cc: Binutils Development
On Thu, Apr 21, 2011 at 01:47:22PM -0600, Tom Tromey wrote:
> * readelf.c (process_corefile_note_segment): Change header field
> widths.
> (process_note): Change field widths.
OK.
--
Alan Modra
Australia Development Lab, IBM
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: RFA: tidy note columns
2011-04-25 23:02 ` Alan Modra
@ 2011-04-26 13:18 ` Tom Tromey
0 siblings, 0 replies; 4+ messages in thread
From: Tom Tromey @ 2011-04-26 13:18 UTC (permalink / raw)
To: Binutils Development
>> * readelf.c (process_corefile_note_segment): Change header field
>> widths.
>> (process_note): Change field widths.
Alan> OK.
Committed.
Tom
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-04-26 13:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-21 17:07 RFA: tidy note columns Tom Tromey
2011-04-21 19:47 ` Tom Tromey
2011-04-25 23:02 ` Alan Modra
2011-04-26 13:18 ` Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).