/* Program and address space management, for GDB, the GNU debugger.
- Copyright (C) 2009-2020 Free Software Foundation, Inc.
+ Copyright (C) 2009-2021 Free Software Foundation, Inc.
This file is part of GDB.
#include <algorithm>
/* The last program space number assigned. */
-int last_program_space_num = 0;
+static int last_program_space_num = 0;
/* The head of the program spaces list. */
std::vector<struct program_space *> program_spaces;
breakpoint_program_space_exit (this);
no_shared_libraries (NULL, 0);
- exec_close ();
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);
- clear_program_space_solib_cache (this);
/* Discard any data modules have associated with the PSPACE. */
program_space_free_data (this);
}
/* See progspace.h. */
-next_adapter<struct so_list>
-program_space::solibs () const
-{
- return next_adapter<struct so_list> (this->so_list);
-}
-
-/* See progspace.h. */
-
void
program_space::exec_close ()
{
/* Returns true iff there's no inferior bound to PSPACE. */
-int
-program_space_empty_p (struct program_space *pspace)
+bool
+program_space::empty ()
{
- if (find_inferior_for_program_space (pspace) != NULL)
- return 0;
-
- return 1;
+ return find_inferior_for_program_space (this) == nullptr;
}
/* Prints the list of program spaces and their details on UIOUT. If
update_address_spaces (void)
{
int shared_aspace = gdbarch_has_shared_address_space (target_gdbarch ());
- struct inferior *inf;
init_address_spaces ();
pspace->aspace = new_address_space ();
}
- for (inf = inferior_list; inf; inf = inf->next)
+ for (inferior *inf : all_inferiors ())
if (gdbarch_has_global_solist (target_gdbarch ()))
inf->aspace = maybe_new_address_space ();
else
/* See progspace.h. */
void
-clear_program_space_solib_cache (struct program_space *pspace)
+program_space::clear_solib_cache ()
{
- pspace->added_solibs.clear ();
- pspace->deleted_solibs.clear ();
+ added_solibs.clear ();
+ deleted_solibs.clear ();
}
\f