breakpoint_program_space_exit (this);
no_shared_libraries (NULL, 0);
breakpoint_program_space_exit (this);
no_shared_libraries (NULL, 0);
free_all_objfiles ();
/* Defer breakpoint re-set because we don't want to create new
locations for this pspace which we're tearing down. */
clear_symtab_users (SYMFILE_DEFER_BP_RESET);
if (!gdbarch_has_shared_address_space (target_gdbarch ()))
free_address_space (this->aspace);
free_all_objfiles ();
/* Defer breakpoint re-set because we don't want to create new
locations for this pspace which we're tearing down. */
clear_symtab_users (SYMFILE_DEFER_BP_RESET);
if (!gdbarch_has_shared_address_space (target_gdbarch ()))
free_address_space (this->aspace);
+ /* Removing an objfile from the objfile list invalidates any frame
+ that was built using frame info found in the objfile. Reinit the
+ frame cache to get rid of any frame that might otherwise
+ reference stale info. */
+ reinit_frame_cache ();
+
auto iter = std::find_if (objfiles_list.begin (), objfiles_list.end (),
[=] (const std::shared_ptr<::objfile> &objf)
{
auto iter = std::find_if (objfiles_list.begin (), objfiles_list.end (),
[=] (const std::shared_ptr<::objfile> &objf)
{
- return next_adapter<struct so_list> (this->so_list);
+ if (ebfd != nullptr)
+ {
+ /* Removing target sections may close the exec_ops target.
+ Clear ebfd before doing so to prevent recursion. */
+ ebfd.reset (nullptr);
+ ebfd_mtime = 0;
+
+ remove_target_sections (&ebfd);
+
+ exec_filename.reset (nullptr);
+ }
- if (src->pspace_exec_filename != NULL)
- exec_file_attach (src->pspace_exec_filename, 0);
+ if (src->exec_filename != NULL)
+ exec_file_attach (src->exec_filename.get (), 0);
if (src->symfile_object_file != NULL)
symbol_file_add_main (objfile_name (src->symfile_object_file),
if (src->symfile_object_file != NULL)
symbol_file_add_main (objfile_name (src->symfile_object_file),
- if (pspace->pspace_exec_filename)
- uiout->field_string ("exec", pspace->pspace_exec_filename);
+ if (pspace->exec_filename != nullptr)
+ uiout->field_string ("exec", pspace->exec_filename.get ());
e.g., both parent/child inferiors in a vfork, or, on targets
that share pspaces between inferiors. */
printed_header = 0;
e.g., both parent/child inferiors in a vfork, or, on targets
that share pspaces between inferiors. */
printed_header = 0;
update_address_spaces (void)
{
int shared_aspace = gdbarch_has_shared_address_space (target_gdbarch ());
update_address_spaces (void)
{
int shared_aspace = gdbarch_has_shared_address_space (target_gdbarch ());
_initialize_foo routines may need to install their per-pspace
data keys. We can only allocate a progspace when all those
modules have done that. Do this before
_initialize_foo routines may need to install their per-pspace
data keys. We can only allocate a progspace when all those
modules have done that. Do this before
- initialize_current_architecture, because that accesses exec_bfd,
- which in turn dereferences current_program_space. */
+ initialize_current_architecture, because that accesses the ebfd
+ of current_program_space. */