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);
- 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);
+ }
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. */