- symbol_file_add_from_bfd (abfd, 0, addrs, 0);
+ /* Make sure that the filename was malloc'ed. The current filename comes
+ either from an OSO symbol name or from an archive name. Memory for both
+ is not managed by gdb. */
+ abfd->filename = xstrdup (abfd->filename);
+
+ /* We need to clear SYMFILE_MAINLINE to avoid interractive question
+ from symfile.c:symbol_file_add_with_addrs_or_offsets. */
+ objfile = symbol_file_add_from_bfd
+ (abfd, symfile_flags & ~SYMFILE_MAINLINE, addrs,
+ main_objfile->flags & (OBJF_REORDERED | OBJF_SHARED
+ | OBJF_READNOW | OBJF_USERLOADED));
+ add_separate_debug_objfile (objfile, main_objfile);