X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=gdb%2Fprogspace.c;h=7080bf8ee2707f0aacd3a7db6d620703e18b6ab4;hb=8677059126a84cb9f71371beb8688138a41014fc;hp=52482ca8f6453e1527507634f4a1274a617dfaf4;hpb=19f6550ebbc922f88026c5c7ebeb04019d47cac2;p=binutils-gdb.git diff --git a/gdb/progspace.c b/gdb/progspace.c index 52482ca8f64..7080bf8ee27 100644 --- a/gdb/progspace.c +++ b/gdb/progspace.c @@ -1,6 +1,6 @@ /* 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. @@ -29,7 +29,7 @@ #include /* 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 program_spaces; @@ -147,14 +147,12 @@ program_space::~program_space () 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); } @@ -217,14 +215,6 @@ program_space::remove_objfile (struct objfile *objfile) /* See progspace.h. */ -next_adapter -program_space::solibs () const -{ - return next_adapter (this->so_list); -} - -/* See progspace.h. */ - void program_space::exec_close () { @@ -281,13 +271,10 @@ set_current_program_space (struct program_space *pspace) /* 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 @@ -417,7 +404,6 @@ void update_address_spaces (void) { int shared_aspace = gdbarch_has_shared_address_space (target_gdbarch ()); - struct inferior *inf; init_address_spaces (); @@ -436,7 +422,7 @@ update_address_spaces (void) 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 @@ -448,10 +434,10 @@ update_address_spaces (void) /* 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 (); }