aboutsummaryrefslogtreecommitdiff
path: root/gdb/objfiles.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2011-04-04 15:19:59 +0000
committerTom Tromey <tromey@redhat.com>2011-04-04 15:19:59 +0000
commit00174a8637c5c42b77b190c38b1afa94c4c14517 (patch)
treee15de61016caa1be91047423ceeff6cd9031e94e /gdb/objfiles.c
parent30cc903e7cd4678ec556d5386be55c3c726b6a27 (diff)
downloadgdb-00174a8637c5c42b77b190c38b1afa94c4c14517.zip
gdb-00174a8637c5c42b77b190c38b1afa94c4c14517.tar.gz
gdb-00174a8637c5c42b77b190c38b1afa94c4c14517.tar.bz2
* symtab.h (free_symtab): Remove.
(forget_cached_source_info_for_objfile): Declare. * symmisc.c (free_symtab): Remove. * source.c (forget_cached_source_info_for_objfile): New function. (forget_cached_source_info): Use it. * objfiles.c (free_objfile): Simplify check before calling clear_current_source_symtab_and_line. Call forget_cached_source_info_for_objfile.
Diffstat (limited to 'gdb/objfiles.c')
-rw-r--r--gdb/objfiles.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index 6c1c91a..1664e42 100644
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -632,15 +632,13 @@ free_objfile (struct objfile *objfile)
{
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 ();
- }
+ if (cursal.symtab && cursal.symtab->objfile == objfile)
+ clear_current_source_symtab_and_line ();
}
+ forget_cached_source_info_for_objfile (objfile);
+
/* The last thing we do is free the objfile struct itself. */
xfree (objfile->name);