* maint.c (print_bfd_section_info): Print the section index.
authorTom Tromey <tromey@redhat.com>
Mon, 8 Apr 2013 20:20:46 +0000 (20:20 +0000)
committerTom Tromey <tromey@redhat.com>
Mon, 8 Apr 2013 20:20:46 +0000 (20:20 +0000)
* symmisc.c (dump_msymbols): Print the section index.

gdb/ChangeLog
gdb/maint.c
gdb/symmisc.c

index de9ae90..f29661f 100644 (file)
@@ -1,5 +1,10 @@
 2013-04-08  Tom Tromey  <tromey@redhat.com>
 
+       * maint.c (print_bfd_section_info): Print the section index.
+       * symmisc.c (dump_msymbols): Print the section index.
+
+2013-04-08  Tom Tromey  <tromey@redhat.com>
+
        PR symtab/8424:
        * blockframe.c (find_pc_partial_function_gnu_ifunc): Check
        SYMBOL_SECTION, not SYMBOL_OBJ_SECTION.
index 63dd25d..18a804a 100644 (file)
@@ -329,6 +329,7 @@ print_bfd_section_info (bfd *abfd,
 
       addr = bfd_section_vma (abfd, asect);
       endaddr = addr + bfd_section_size (abfd, asect);
+      printf_filtered (" [%d] ", gdb_bfd_section_index (abfd, asect));
       maint_print_section_info (name, flags, addr, endaddr,
                                asect->filepos, addr_size);
     }
index 4156fc6..c4bf97e 100644 (file)
@@ -261,9 +261,15 @@ dump_msymbols (struct objfile *objfile, struct ui_file *outfile)
                      outfile);
       fprintf_filtered (outfile, " %s", SYMBOL_LINKAGE_NAME (msymbol));
       if (section)
-       fprintf_filtered (outfile, " section %s",
-                         bfd_section_name (objfile->obfd,
-                                           section->the_bfd_section));
+       {
+         if (section->the_bfd_section != NULL)
+           fprintf_filtered (outfile, " section %s",
+                             bfd_section_name (objfile->obfd,
+                                               section->the_bfd_section));
+         else
+           fprintf_filtered (outfile, " spurious section %ld",
+                             section - objfile->sections);
+       }
       if (SYMBOL_DEMANGLED_NAME (msymbol) != NULL)
        {
          fprintf_filtered (outfile, "  %s", SYMBOL_DEMANGLED_NAME (msymbol));