summaryrefslogtreecommitdiff
path: root/gdb/objfiles.c
diff options
context:
space:
mode:
authorFred Fish <fnf@specifix.com>2006-01-06 16:23:35 +0000
committerFred Fish <fnf@specifix.com>2006-01-06 16:23:35 +0000
commit8a1433c64e7eaa21cff368f7278fc9dd1a4add15 (patch)
tree5a72d31d9bb7e54d313e57bf6036de361c73b71d /gdb/objfiles.c
parent9661efa275e0beb2fb2523ce4ecf53e1743fe141 (diff)
downloadgdb-8a1433c64e7eaa21cff368f7278fc9dd1a4add15.tar.gz
Reviewed and approved by Jim Blandy
2006-01-06 Fred Fish <fnf@specifix.com> * objfiles.c (source.h): Include. (free_objfile): Update comment about clear_symtab_users(). (free_objfile): Check all symtabs of objfile being freed and if one of them is the current source symtab, call clear_current_source_symtab_and_line().
Diffstat (limited to 'gdb/objfiles.c')
-rw-r--r--gdb/objfiles.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index 459709adf44..41aab64594a 100644
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -45,6 +45,7 @@
#include "breakpoint.h"
#include "block.h"
#include "dictionary.h"
+#include "source.h"
/* Prototypes for local functions */
@@ -432,10 +433,24 @@ free_objfile (struct objfile *objfile)
is unknown, but we play it safe for now and keep each action until
it is shown to be no longer needed. */
- /* I *think* all our callers call clear_symtab_users. If so, no need
- to call this here. */
+ /* Not all our callers call clear_symtab_users (objfile_purge_solibs,
+ for example), so we need to call this here. */
clear_pc_function_cache ();
+ /* Check to see if the current_source_symtab belongs to this objfile,
+ and if so, call clear_current_source_symtab_and_line. */
+
+ {
+ struct symtab_and_line cursal = get_current_source_symtab_and_line ();
+ struct symtab *s;
+
+ ALL_OBJFILE_SYMTABS (objfile, s)
+ {
+ if (s == cursal.symtab)
+ clear_current_source_symtab_and_line ();
+ }
+ }
+
/* The last thing we do is free the objfile struct itself. */
objfile_free_data (objfile);