From 8625fc1bbae9c0c26859f3f6b2111f737d897d15 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 8 Apr 2013 20:20:46 +0000 Subject: [PATCH] * maint.c (print_bfd_section_info): Print the section index. * symmisc.c (dump_msymbols): Print the section index. --- gdb/ChangeLog | 5 +++++ gdb/maint.c | 1 + gdb/symmisc.c | 12 +++++++++--- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index de9ae9022e5..f29661fdab9 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2013-04-08 Tom Tromey + + * maint.c (print_bfd_section_info): Print the section index. + * symmisc.c (dump_msymbols): Print the section index. + 2013-04-08 Tom Tromey PR symtab/8424: diff --git a/gdb/maint.c b/gdb/maint.c index 63dd25dc972..18a804a955a 100644 --- a/gdb/maint.c +++ b/gdb/maint.c @@ -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); } diff --git a/gdb/symmisc.c b/gdb/symmisc.c index 4156fc64de3..c4bf97e37c7 100644 --- a/gdb/symmisc.c +++ b/gdb/symmisc.c @@ -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));