aboutsummaryrefslogtreecommitdiff
path: root/gdb/elfread.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2013-02-01 19:39:04 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2013-02-01 19:39:04 +0000
commit8a92335bfca80cc9b4cd217505ea0dcbfdefbf07 (patch)
tree1a2727b6fdead4c6894d9cdefc072b0d04fcd1bc /gdb/elfread.c
parent17f2157dcc39cd6c5786ba70dd130e858728f1ac (diff)
downloadfsf-binutils-gdb-8a92335bfca80cc9b4cd217505ea0dcbfdefbf07.zip
fsf-binutils-gdb-8a92335bfca80cc9b4cd217505ea0dcbfdefbf07.tar.gz
fsf-binutils-gdb-8a92335bfca80cc9b4cd217505ea0dcbfdefbf07.tar.bz2
gdb/
* elfread.c (elf_symfile_read): Limit separate debug info additions to files with no separate debug info. * objfiles.c (add_separate_debug_objfile): Add gdb_assert calls. * symfile.c (read_symbols): Call find_separate_debug_file_in_section only for files with no separate debug info. gdb/testsuite/ * gdb.base/gnu-debugdata.exp): Create ${binfile}.debug, ${binfile}.mini_debuginfo-debuglink, add -k to xz, use now ${binfile}.mini_debuginfo-debuglink and ${binfile}.mini_debuginfo-debuglink.xz.
Diffstat (limited to 'gdb/elfread.c')
-rw-r--r--gdb/elfread.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/gdb/elfread.c b/gdb/elfread.c
index 9d630cd..6ca659f9 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -1431,8 +1431,18 @@ elf_symfile_read (struct objfile *objfile, int symfile_flags)
/* If the file has its own symbol tables it has no separate debug
info. `.dynsym'/`.symtab' go to MSYMBOLS, `.debug_info' goes to
SYMTABS/PSYMTABS. `.gnu_debuglink' may no longer be present with
- `.note.gnu.build-id'. */
- else if (!objfile_has_partial_symbols (objfile))
+ `.note.gnu.build-id'.
+
+ .gnu_debugdata is !objfile_has_partial_symbols because it contains only
+ .symtab, not .debug_* section. But if we already added .gnu_debugdata as
+ an objfile via find_separate_debug_file_in_section there was no separate
+ debug info available. Therefore do not attempt to search for another one,
+ objfile->separate_debug_objfile->separate_debug_objfile GDB guarantees to
+ be NULL and we would possibly violate it. */
+
+ else if (!objfile_has_partial_symbols (objfile)
+ && objfile->separate_debug_objfile == NULL
+ && objfile->separate_debug_objfile_backlink == NULL)
{
char *debugfile;