virtual section-as-bfd like the bfd filename containing the
section. Therefore use also non-canonical name form for the same
file containing the section. */
- symbol_file_add_separate (abfd.get (), objfile->original_name,
- add_flags, objfile);
+ symbol_file_add_separate (abfd.get (),
+ bfd_get_filename (abfd.get ()),
+ add_flags | SYMFILE_NOT_FILENAME, objfile);
}
}
if ((add_flags & SYMFILE_NO_READ) == 0)
initial symbol reading for this file. */
(*objfile->sf->sym_init) (objfile);
- clear_complaints (&symfile_complaints, 1, add_flags & SYMFILE_VERBOSE);
+ clear_complaints (&symfile_complaints, 1);
(*objfile->sf->sym_offsets) (objfile, *addrs);
}
/* We're done reading the symbol file; finish off complaints. */
- clear_complaints (&symfile_complaints, 0, add_flags & SYMFILE_VERBOSE);
+ clear_complaints (&symfile_complaints, 0);
}
/* Process a symbol file, as either the main file or as a dynamically
flags |= OBJF_READNEVER;
add_flags |= SYMFILE_NO_READ;
}
+ if ((add_flags & SYMFILE_NOT_FILENAME) != 0)
+ flags |= OBJF_NOT_FILENAME;
/* Give user a chance to burp if we'd be
interactively wiping out any existing symbols. */
struct cleanup *old_cleanups;
struct section_offsets *offsets;
int num_offsets;
- char *original_name;
printf_unfiltered (_("`%s' has changed; re-reading symbols.\n"),
objfile_name (objfile));
error (_("Can't open %s to read symbols."), obfd_filename);
}
- original_name = xstrdup (objfile->original_name);
- make_cleanup (xfree, original_name);
+ std::string original_name = objfile->original_name;
/* bfd_openr sets cacheable to true, which is what we want. */
if (!bfd_check_format (objfile->obfd, bfd_object))
set_objfile_per_bfd (objfile);
objfile->original_name
- = (char *) obstack_copy0 (&objfile->objfile_obstack, original_name,
- strlen (original_name));
+ = (char *) obstack_copy0 (&objfile->objfile_obstack,
+ original_name.c_str (),
+ original_name.size ());
/* Reset the sym_fns pointer. The ELF reader can change it
based on whether .gdb_index is present, and we need it to
}
(*objfile->sf->sym_init) (objfile);
- clear_complaints (&symfile_complaints, 1, 1);
+ clear_complaints (&symfile_complaints, 1);
objfile->flags &= ~OBJF_PSYMTABS_READ;
}
/* We're done reading the symbol file; finish off complaints. */
- clear_complaints (&symfile_complaints, 0, 1);
+ clear_complaints (&symfile_complaints, 0);
/* Getting new symbols may change our opinion about what is
frameless. */