mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-12-19 01:19:41 +08:00
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.
This commit is contained in:
24
gdb/source.c
24
gdb/source.c
@@ -420,34 +420,12 @@ 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;
|
||||
|
||||
Reference in New Issue
Block a user