/* Generic symbol file reading for the GNU debugger, GDB.
- Copyright (C) 1990-2019 Free Software Foundation, Inc.
+ Copyright (C) 1990-2020 Free Software Foundation, Inc.
Contributed by Cygnus Support, using pieces from other GDB modules.
#include "completer.h"
#include "bcache.h"
#include "hashtab.h"
-#include "readline/readline.h"
+#include "readline/tilde.h"
#include "block.h"
#include "observable.h"
#include "exec.h"
}
}
if ((add_flags & SYMFILE_NO_READ) == 0)
- require_partial_symbols (objfile, 0);
+ require_partial_symbols (objfile, false);
}
/* Initialize entry point information for this objfile. */
if an error occurs during symbol reading. */
gdb::optional<clear_symtab_users_cleanup> defer_clear_users;
- std::unique_ptr<struct objfile> objfile_holder (objfile);
+ objfile_up objfile_holder (objfile);
/* If ADDRS is NULL, put together a dummy address list.
We now establish the convention that an addr of zero means
if (symfile_objfile != NULL)
{
- delete symfile_objfile;
+ symfile_objfile->unlink ();
gdb_assert (symfile_objfile == NULL);
}
For NAME description see the objfile constructor.
ADD_FLAGS encodes verbosity, whether this is main symbol file or
- extra, such as dynamically loaded code, and what to do with breakpoins.
+ extra, such as dynamically loaded code, and what to do with breakpoints.
ADDRS is as described for syms_from_objfile_1, above.
ADDRS is ignored when SYMFILE_MAINLINE bit is set in ADD_FLAGS.
if (mainline)
flags |= OBJF_MAINLINE;
- objfile = new struct objfile (abfd, name, flags);
-
- if (parent)
- add_separate_debug_objfile (objfile, parent);
+ objfile = objfile::make (abfd, name, flags, parent);
/* We either created a new mapped symbol table, mapped an existing
symbol table file which has not had initial symbol reading
objfiles get stale by free_all_objfiles. */
no_shared_libraries (NULL, from_tty);
- free_all_objfiles ();
+ current_program_space->free_all_objfiles ();
gdb_assert (symfile_objfile == NULL);
if (from_tty)
struct symbol *sym = lookup_symbol (name, NULL, VAR_DOMAIN, NULL).symbol;
if (sym != NULL)
- lang = SYMBOL_LANGUAGE (sym);
+ lang = sym->language ();
}
if (lang == language_unknown)
objfile_name (objf)))
error (_("Not confirmed."));
- delete objf;
+ objf->unlink ();
clear_symtab_users (0);
}
/* If we get an error, blow away this objfile (not sure if
that is the correct response for things like shared
libraries). */
- std::unique_ptr<struct objfile> objfile_holder (objfile);
+ objfile_up objfile_holder (objfile);
/* We need to do this whenever any symbols go away. */
clear_symtab_users_cleanup defer_clear_users (0);
automatically recreated by sym_read. */
free_objfile_separate_debug (objfile);
+ /* Clear the stale source cache. */
+ forget_cached_source_info ();
+
/* Remove any references to this objfile in the global
value lists. */
preserve_values (objfile);