From 8a92335bfca80cc9b4cd217505ea0dcbfdefbf07 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Fri, 1 Feb 2013 19:39:04 +0000 Subject: 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. --- gdb/symfile.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gdb/symfile.c') diff --git a/gdb/symfile.c b/gdb/symfile.c index 63bf329..6f968b7 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -823,7 +823,12 @@ static void read_symbols (struct objfile *objfile, int add_flags) { (*objfile->sf->sym_read) (objfile, add_flags); - if (!objfile_has_partial_symbols (objfile)) + + /* find_separate_debug_file_in_section should be called only if there is + single binary with no existing separate debug info file. */ + if (!objfile_has_partial_symbols (objfile) + && objfile->separate_debug_objfile == NULL + && objfile->separate_debug_objfile_backlink == NULL) { bfd *abfd = find_separate_debug_file_in_section (objfile); struct cleanup *cleanup = make_cleanup_bfd_unref (abfd); -- cgit v1.1