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().
This commit is contained in:
Fred Fish
2006-01-06 16:23:35 +00:00
parent 7983a4a1b3
commit cb5d864f33
2 changed files with 25 additions and 2 deletions

View File

@ -1,3 +1,11 @@
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().
2006-01-04 Michael Snyder <msnyder@redhat.com> 2006-01-04 Michael Snyder <msnyder@redhat.com>
Checkpoint/Restart for Linux. Checkpoint/Restart for Linux.

View File

@ -45,6 +45,7 @@
#include "breakpoint.h" #include "breakpoint.h"
#include "block.h" #include "block.h"
#include "dictionary.h" #include "dictionary.h"
#include "source.h"
/* Prototypes for local functions */ /* 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 is unknown, but we play it safe for now and keep each action until
it is shown to be no longer needed. */ it is shown to be no longer needed. */
/* I *think* all our callers call clear_symtab_users. If so, no need /* Not all our callers call clear_symtab_users (objfile_purge_solibs,
to call this here. */ for example), so we need to call this here. */
clear_pc_function_cache (); 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. */ /* The last thing we do is free the objfile struct itself. */
objfile_free_data (objfile); objfile_free_data (objfile);