aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog8
-rw-r--r--gdb/inferior.c2
-rw-r--r--gdb/progspace.c9
-rw-r--r--gdb/progspace.h7
4 files changed, 16 insertions, 10 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 9793194..1286d57 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,13 @@
2020-10-29 Tom Tromey <tom@tromey.com>
+ * inferior.c (delete_inferior): Update.
+ * progspace.c (program_space::empty): Rename from
+ program_space_empty_p. Return bool.
+ * progspace.h (struct program_space) <empty>: New method.
+ (program_space_empty_p): Don't declare.
+
+2020-10-29 Tom Tromey <tom@tromey.com>
+
* progspace.c (program_space::~program_space): Don't call
clear_program_space_solib_cache.
(program_space::clear_solib_cache): Rename from
diff --git a/gdb/inferior.c b/gdb/inferior.c
index fc21241..12f4de4 100644
--- a/gdb/inferior.c
+++ b/gdb/inferior.c
@@ -175,7 +175,7 @@ delete_inferior (struct inferior *todel)
gdb::observers::inferior_removed.notify (inf);
/* If this program space is rendered useless, remove it. */
- if (program_space_empty_p (inf->pspace))
+ if (inf->pspace->empty ())
delete inf->pspace;
delete inf;
diff --git a/gdb/progspace.c b/gdb/progspace.c
index 84baaea..70c0f7e 100644
--- a/gdb/progspace.c
+++ b/gdb/progspace.c
@@ -280,13 +280,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
diff --git a/gdb/progspace.h b/gdb/progspace.h
index 22805d7..fa5247f 100644
--- a/gdb/progspace.h
+++ b/gdb/progspace.h
@@ -293,6 +293,10 @@ struct program_space
later be printed. */
void clear_solib_cache ();
+ /* Returns true iff there's no inferior bound to this program
+ space. */
+ bool empty ();
+
/* Unique ID number. */
int num = 0;
@@ -383,9 +387,6 @@ extern std::vector<struct program_space *>program_spaces;
/* The current program space. This is always non-null. */
extern struct program_space *current_program_space;
-/* Returns true iff there's no inferior bound to PSPACE. */
-extern int program_space_empty_p (struct program_space *pspace);
-
/* Copies program space SRC to DEST. Copies the main executable file,
and the main symbol file. Returns DEST. */
extern struct program_space *clone_program_space (struct program_space *dest,