static void
ada_tasks_invalidate_pspace_data (struct program_space *pspace)
{
- get_ada_tasks_pspace_data (pspace)->initialized_p = 0;
+ ada_tasks_pspace_data_handle.clear (pspace);
}
/* Invalidate the per-inferior data. */
static void
ada_tasks_invalidate_inferior_data (struct inferior *inf)
{
- struct ada_tasks_inferior_data *data = get_ada_tasks_inferior_data (inf);
-
- data->known_tasks_kind = ADA_TASKS_UNKNOWN;
- data->task_list_valid_p = false;
+ ada_tasks_inferior_data_handle.clear (inf);
}
/* The 'normal_stop' observer notification callback. */
/* Check to see if the current_source_symtab belongs to this objfile,
and if so, call clear_current_source_symtab_and_line. */
-
- {
- symtab_and_line cursal
- = get_current_source_symtab_and_line (this->pspace ());
-
- if (cursal.symtab && cursal.symtab->compunit ()->objfile () == this)
- clear_current_source_symtab_and_line (this->pspace ());
- }
+ clear_current_source_symtab_and_line (this);
/* Rebuild section map next time we need it. */
- get_objfile_pspace_data (m_pspace)->section_map_dirty = 1;
+ auto info = objfiles_pspace_data.get (pspace ());
+ if (info != nullptr)
+ info->section_map_dirty = 1;
}
\f
static void
probes_table_remove_objfile_probes (struct objfile *objfile)
{
- svr4_info *info = get_svr4_info (objfile->pspace ());
- if (info->probes_table != nullptr)
- htab_traverse_noresize (info->probes_table.get (),
- probes_table_htab_remove_objfile_probes, objfile);
+ svr4_info *info = solib_svr4_pspace_data.get (objfile->pspace ());
+ if (info == nullptr || info->probes_table == nullptr)
+ return;
+
+ htab_traverse_noresize (info->probes_table.get (),
+ probes_table_htab_remove_objfile_probes, objfile);
}
/* Register a solib event probe and its associated action in the
void
clear_current_source_symtab_and_line (program_space *pspace)
{
- current_source_location *loc = get_source_location (pspace);
+ current_source_location *loc = current_source_key.get (pspace);
+ if (loc == nullptr)
+ return;
+
loc->set (nullptr, 0);
}
+/* Reset any information stored about a default file and line to print, if it's
+ owned by OBJFILE. */
+
+void
+clear_current_source_symtab_and_line (objfile *objfile)
+{
+ current_source_location *loc = current_source_key.get (objfile->pspace ());
+ if (loc == nullptr)
+ return;
+
+ if (loc->symtab () != nullptr
+ && loc->symtab ()->compunit ()->objfile () == objfile)
+ clear_current_source_symtab_and_line (objfile->pspace ());
+}
+
/* See source.h. */
void
struct program_space;
struct symtab;
struct symtab_and_line;
+struct objfile;
/* See openp function definition for their description. */
/* Reset any information stored about a default file and line to print. */
extern void clear_current_source_symtab_and_line (program_space *pspace);
+extern void clear_current_source_symtab_and_line (objfile *objfile);
/* Add a source path substitution rule. */
extern void add_substitute_path_rule (const char *, const char *);
symbol_cache_flush (pspace);
/* Forget everything we know about the main function. */
- set_main_name (pspace, nullptr, language_unknown);
+ main_progspace_key.clear (pspace);
}
/* This module's 'free_objfile' observer. */