aboutsummaryrefslogtreecommitdiff
path: root/gdb/source.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-02-21 15:03:38 -0700
committerTom Tromey <tom@tromey.com>2023-03-07 14:46:58 -0700
commit21f6be77b97e1d606881966fd4e407fde459a639 (patch)
treeafb3ecd473c706fb12655b58b31028963d6fef83 /gdb/source.c
parent2a32d78f8aa6ddce2642067960f90173466dcc10 (diff)
downloadgdb-21f6be77b97e1d606881966fd4e407fde459a639.zip
gdb-21f6be77b97e1d606881966fd4e407fde459a639.tar.gz
gdb-21f6be77b97e1d606881966fd4e407fde459a639.tar.bz2
Merge forget_cached_source_info_for_objfile into objfile method
forget_cached_source_info_for_objfile does some objfile-specific work and then calls objfile::forget_cached_source_info. It seems better to me to just have the method do all the work.
Diffstat (limited to 'gdb/source.c')
-rw-r--r--gdb/source.c24
1 files changed, 1 insertions, 23 deletions
diff --git a/gdb/source.c b/gdb/source.c
index ca0e8d5..faf0be6 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -421,33 +421,11 @@ show_directories_command (struct ui_file *file, int from_tty,
/* See source.h. */
void
-forget_cached_source_info_for_objfile (struct objfile *objfile)
-{
- for (compunit_symtab *cu : objfile->compunits ())
- {
- for (symtab *s : cu->filetabs ())
- {
- if (s->fullname != NULL)
- {
- xfree (s->fullname);
- s->fullname = NULL;
- }
- }
- }
-
- objfile->forget_cached_source_info ();
-}
-
-/* See source.h. */
-
-void
forget_cached_source_info (void)
{
for (struct program_space *pspace : program_spaces)
for (objfile *objfile : pspace->objfiles ())
- {
- forget_cached_source_info_for_objfile (objfile);
- }
+ objfile->forget_cached_source_info ();
g_source_cache.clear ();
last_source_visited = NULL;