diff options
author | Tom Tromey <tom@tromey.com> | 2023-07-09 18:46:53 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2023-07-10 15:43:08 -0600 |
commit | 57685738614a0089fba7f79669392b8d66d7c6af (patch) | |
tree | 0a18ff62ea218beea528c373209ddfbdfb12b22f /gdb/target.h | |
parent | 9fe01a376b2fb096e4836e985ba316ce9dc02399 (diff) | |
download | gdb-57685738614a0089fba7f79669392b8d66d7c6af.zip gdb-57685738614a0089fba7f79669392b8d66d7c6af.tar.gz gdb-57685738614a0089fba7f79669392b8d66d7c6af.tar.bz2 |
Remove target_close
I noticed that target_close is only called in two places:
solib-svr4.c, and target_ops_ref_policy::decref.
This patch fixes the former by changing target_bfd_reopen to return a
target_ops_up and then fixing the sole caller. Then it removes
target_close by inlining its body into the decref method.
The advantage of this approach is that targets are now automatically
managed.
Regression tested on x86-64 Fedora 38.
Approved-By: Andrew Burgess <aburgess@redhat.com>
Diffstat (limited to 'gdb/target.h')
-rw-r--r-- | gdb/target.h | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/gdb/target.h b/gdb/target.h index 5f9a2a2..6ae400e 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -1410,15 +1410,6 @@ extern target_ops *get_dummy_target (); extern const char *target_shortname (); -/* Does whatever cleanup is required for a target that we are no - longer going to be calling. This routine is automatically always - called after popping the target off the target stack - the target's - own methods are no longer available through the target vector. - Closing file descriptors and freeing all memory allocated memory are - typical things it should do. */ - -void target_close (struct target_ops *targ); - /* Find the correct target to use for "attach". If a target on the current stack supports attaching, then it is returned. Otherwise, the default run target is returned. */ |