summaryrefslogtreecommitdiff
path: root/gdb/elfread.c
diff options
context:
space:
mode:
authorTristan Gingold <gingold@adacore.com>2009-12-09 13:44:51 +0000
committerTristan Gingold <gingold@adacore.com>2009-12-09 13:44:51 +0000
commitffb64a120e667bad7b2a79c5e617bdea7328f996 (patch)
tree3d4feeb781b01e435898c7b5a188b46bcbc1d842 /gdb/elfread.c
parent3e17ca4ee390a644d9787aff5af56447e466f684 (diff)
downloadgdb-ffb64a120e667bad7b2a79c5e617bdea7328f996.tar.gz
2009-12-02 Tristan Gingold <gingold@adacore.com>
* symfile.h (symbol_file_add_separate): New prototype. (find_separate_debug_file_by_buildid): Ditto. (find_separate_debug_file_by_debuglink): Ditto. * symfile.c (reread_separate_symbols): Remove. (find_separate_debug_file): Split into ... (find_separate_debug_file_by_buildid): ... this and ... (find_separate_debug_file_by_debuglink): ... this. (symbol_file_add_with_addrs_or_offsets): Do not save orig_addrs. Remove separate debug file handling. (symbol_file_add_separate): New function. (reread_symbols): Do not considere separate debug files, but free them while handling their parent. Reindent. * coffread.c (coff_symfile_read): Handle separate object file. * elfread.c (elf_symfile_read): Ditto.
Diffstat (limited to 'gdb/elfread.c')
-rw-r--r--gdb/elfread.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gdb/elfread.c b/gdb/elfread.c
index dd844fc8dbf..a47e687fb63 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -737,6 +737,26 @@ elf_symfile_read (struct objfile *objfile, int symfile_flags)
/* FIXME: kettenis/20030504: This still needs to be integrated with
dwarf2read.c in a better way. */
dwarf2_build_frame_info (objfile);
+
+ /* 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'. */
+ if (!objfile_has_partial_symbols (objfile))
+ {
+ char *debugfile;
+
+ debugfile = find_separate_debug_file_by_buildid (objfile);
+
+ if (debugfile == NULL)
+ debugfile = find_separate_debug_file_by_debuglink (objfile);
+
+ if (debugfile)
+ {
+ bfd *abfd = symfile_bfd_open (debugfile);
+ symbol_file_add_separate (abfd, symfile_flags, objfile);
+ xfree (debugfile);
+ }
+ }
}
/* This cleans up the objfile's deprecated_sym_stab_info pointer, and