diff options
author | Andrew Burgess <aburgess@redhat.com> | 2022-09-22 12:22:22 +0100 |
---|---|---|
committer | Andrew Burgess <aburgess@redhat.com> | 2022-12-14 13:57:22 +0000 |
commit | c8181f706f5a481e9667195d1f5d1623db6cc7f2 (patch) | |
tree | 6f4bf3f6732629ce964a48226c97e32c3125989a /gdb/target.h | |
parent | 9678f8fe975c213c94735221dcb438395e4de9e1 (diff) | |
download | binutils-gdb-c8181f706f5a481e9667195d1f5d1623db6cc7f2.tar.gz |
gdb: remove the pop_all_targets (and friends) global functions
This commit removes the global functions pop_all_targets,
pop_all_targets_above, and pop_all_targets_at_and_above, and makes
them methods on the inferior class.
As the pop_all_targets functions will unpush each target, which
decrements the targets reference count, it is possible that the target
might be closed.
Right now, closing a target, in some cases, depends on the current
inferior being set correctly, that is, to the inferior from which the
target was popped.
To facilitate this I have used switch_to_inferior_no_thread within the
new methods. Previously it was the responsibility of the caller to
ensure that the correct inferior was selected.
In a couple of places (event-top.c and top.c) I have been able to
remove a previous switch_to_inferior_no_thread call.
In remote_unpush_target (remote.c) I have left the
switch_to_inferior_no_thread call as it is required for the
generic_mourn_inferior call.
Diffstat (limited to 'gdb/target.h')
-rw-r--r-- | gdb/target.h | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/gdb/target.h b/gdb/target.h index 68446a39c1b..547ee8a3bbd 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -2389,17 +2389,6 @@ extern void target_pre_inferior (int); extern void target_preopen (int); -/* Does whatever cleanup is required to get rid of all pushed targets. */ -extern void pop_all_targets (void); - -/* Like pop_all_targets, but pops only targets whose stratum is at or - above STRATUM. */ -extern void pop_all_targets_at_and_above (enum strata stratum); - -/* Like pop_all_targets, but pops only targets whose stratum is - strictly above ABOVE_STRATUM. */ -extern void pop_all_targets_above (enum strata above_stratum); - extern CORE_ADDR target_translate_tls_address (struct objfile *objfile, CORE_ADDR offset); |