aboutsummaryrefslogtreecommitdiff
path: root/gdb/symfile.c
diff options
context:
space:
mode:
authorJohn Gilmore <gnu@cygnus>1991-04-13 22:37:48 +0000
committerJohn Gilmore <gnu@cygnus>1991-04-13 22:37:48 +0000
commit0ef6f0192d06aa2b346ea4c1fe013abc39e1b562 (patch)
tree643ab11af75f62d85446f452fd47b86db00355ae /gdb/symfile.c
parentd219db0133b5317cbd3f5a1ae7633a2156656511 (diff)
downloadgdb-0ef6f0192d06aa2b346ea4c1fe013abc39e1b562.zip
gdb-0ef6f0192d06aa2b346ea4c1fe013abc39e1b562.tar.gz
gdb-0ef6f0192d06aa2b346ea4c1fe013abc39e1b562.tar.bz2
Permit symbols to be superseded when new symbol files have
been read in, particularly for VxWorks. * symfile.c (symbol_file_add): Use filtered printing and wrap it. If we have wiped out any old symbol tables, clean up at end of symbol reading. (symbol_file_command): Don't reference symfile_fns if it's zero.
Diffstat (limited to 'gdb/symfile.c')
-rw-r--r--gdb/symfile.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/gdb/symfile.c b/gdb/symfile.c
index 31aa1e2..d2f8255 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -413,7 +413,8 @@ symbol_file_add (name, from_tty, addr, mainline)
if (from_tty)
{
- printf ("Reading symbol data from %s...", name);
+ printf_filtered ("Reading symbol data from %s...", name);
+ wrap_here ("");
fflush (stdout);
}
@@ -457,9 +458,12 @@ symbol_file_add (name, from_tty, addr, mainline)
symfile_fns = sf;
}
+ /* If we have wiped out any old symbol tables, clean up. */
+ clear_symtab_users_once ();
+
if (from_tty)
{
- printf ("done.\n");
+ printf_filtered ("done.\n");
fflush (stdout);
}
}
@@ -489,9 +493,11 @@ symbol_file_command (name, from_tty)
/* FIXME, this does not account for the main file and subsequent
files (shared libs, dynloads, etc) having different formats.
It only calls the cleanup routine for the main file's format. */
- (*symfile_fns->sym_new_init) ();
- free (symfile_fns);
- symfile_fns = 0;
+ if (symfile_fns) {
+ (*symfile_fns->sym_new_init) ();
+ free (symfile_fns);
+ symfile_fns = 0;
+ }
return;
}