This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

RFA: minor fixes to readelf


I noticed a few output oddities with readelf -w.  This patch fixes all
of them.

* Some places print "Contents of the %s section" and some print "The
  section %s contains".  I made them uniform; this is nicer for
  grepping.

* The debug_pubnames indexes are printed in decimal while other
  indexes use hex.  I changed this to use hex, for easier searching.
  I also removed an extra tab.

* I fixed the indentation of the aranges output.

This required a minor test suite change.

Ok?

Tom

ChangeLog:
2008-09-25  Tom Tromey  <tromey@redhat.com>

	* dwarf.c (display_debug_frames): Change text for uniformity.
	(process_debug_info): Likewise.
	(display_debug_aranges): Likewise.  Indent address output.
	(display_debug_pubnames): Print offset in hex.

testsuite/ChangeLog:
2008-09-25  Tom Tromey  <tromey@redhat.com>

	* binutils-all/objdump.W: Update.

Index: dwarf.c
===================================================================
RCS file: /cvs/src/src/binutils/dwarf.c,v
retrieving revision 1.40
diff -u -r1.40 dwarf.c
--- dwarf.c	24 Sep 2008 23:21:03 -0000	1.40
+++ dwarf.c	26 Sep 2008 00:22:49 -0000
@@ -1839,7 +1839,7 @@
 
   if (!do_loc)
     {
-      printf (_("The section %s contains:\n\n"), section->name);
+      printf (_("Contents of the %s section:\n\n"), section->name);
 
       load_debug_section (str, file);
     }
@@ -2904,7 +2904,7 @@
 	  if (offset != 0)
 	    {
 	      data += offset_size;
-	      printf ("    %-6ld\t\t%s\n", offset, data);
+	      printf ("    %-6lx\t%s\n", offset, data);
 	      data += strlen ((char *) data) + 1;
 	    }
 	}
@@ -3322,7 +3322,7 @@
   unsigned char *start = section->start;
   unsigned char *end = start + section->size;
 
-  printf (_("The section %s contains:\n\n"), section->name);
+  printf (_("Contents of the %s section:\n\n"), section->name);
 
   /* It does not matter if this load fails,
      we test for that later on.  */
@@ -3423,6 +3423,7 @@
 
 	  ranges += address_size;
 
+	  printf ("    ");
 	  print_dwarf_vma (address, address_size);
 	  print_dwarf_vma (length, address_size);
 	  putchar ('\n');
@@ -3814,7 +3815,7 @@
   unsigned int length_return;
   int max_regs = 0;
 
-  printf (_("The section %s contains:\n"), section->name);
+  printf (_("Contents of the %s section:\n"), section->name);
 
   while (start < end)
     {
Index: testsuite/binutils-all/objdump.W
===================================================================
RCS file: /cvs/src/src/binutils/testsuite/binutils-all/objdump.W,v
retrieving revision 1.2
diff -u -r1.2 objdump.W
--- testsuite/binutils-all/objdump.W	11 Jul 2008 10:47:29 -0000	1.2
+++ testsuite/binutils-all/objdump.W	26 Sep 2008 00:22:49 -0000
@@ -1,7 +1,7 @@
 
 tmpdir/dw2-compressed.o:     file format .*
 
-The section .debug_info contains:
+Contents of the .debug_info section:
 
   Compilation Unit @ offset 0x0:
    Length:        0x4e \(32-bit\)


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