X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fsymfile.c;h=e48089a1301bda2fdee41304329c7ac3481a34a1;hb=4e9668d0d1ddad73af7c20a92a00704fbea2a8d9;hp=b0a5f118346673fdec0108446725d544232460c6;hpb=86a73007627a3c52d1c624ed430ac0e74fb8cc3e;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/symfile.c b/gdb/symfile.c index b0a5f11834..e48089a130 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -808,8 +808,9 @@ read_symbols (struct objfile *objfile, symfile_add_flags add_flags) 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) @@ -985,7 +986,7 @@ syms_from_objfile_1 (struct objfile *objfile, 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); @@ -1032,7 +1033,7 @@ finish_new_objfile (struct objfile *objfile, symfile_add_flags add_flags) } /* 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 @@ -1079,6 +1080,8 @@ symbol_file_add_with_addrs (bfd *abfd, const char *name, 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. */ @@ -2313,7 +2316,6 @@ reread_symbols (void) 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)); @@ -2379,8 +2381,7 @@ reread_symbols (void) 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)) @@ -2426,8 +2427,9 @@ reread_symbols (void) 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 @@ -2455,7 +2457,7 @@ reread_symbols (void) } (*objfile->sf->sym_init) (objfile); - clear_complaints (&symfile_complaints, 1, 1); + clear_complaints (&symfile_complaints, 1); objfile->flags &= ~OBJF_PSYMTABS_READ; @@ -2485,7 +2487,7 @@ reread_symbols (void) } /* 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. */