diff options
author | Pedro Alves <palves@redhat.com> | 2018-05-03 00:37:09 +0100 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2018-05-03 00:48:05 +0100 |
commit | 3fffc0701a26bc0baa563fdc793cafb3d3f02a93 (patch) | |
tree | d06a731f3dea412b5cf392e43d0baf78d6b5151d /gdb/target.h | |
parent | 6798487f5bc66ab9c34ad81fa28ba25d32a00bd9 (diff) | |
download | gdb-3fffc0701a26bc0baa563fdc793cafb3d3f02a93.zip gdb-3fffc0701a26bc0baa563fdc793cafb3d3f02a93.tar.gz gdb-3fffc0701a26bc0baa563fdc793cafb3d3f02a93.tar.bz2 |
Eliminate target_ops::to_xclose
In the multi-target branch, I found no need for the target_close vs
target_xclose distinction. Heap-allocated targets simply delete
themselves in their target_close implementation, while
singleton/static targets don't.
The target_ops C++ification patches will add more commentary around
target_ops's destructor, but there's no destructor yet...
gdb/ChangeLog:
2018-05-02 Pedro Alves <palves@redhat.com>
* bfd-target.c (target_bfd_xclose): Rename to ...
(target_bfd_close): ... this.
(target_bfd_reopen): Adjust.
* target.c (target_close): Remove references to to_xclose.
* target.h (target_ops::to_xclose): Delete.
(target_ops::to_close): Update comments.
Diffstat (limited to 'gdb/target.h')
-rw-r--r-- | gdb/target.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gdb/target.h b/gdb/target.h index f208b10..f329362 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -418,11 +418,12 @@ struct target_ops stack. Targets should supply this routine, if only to provide an error message. */ void (*to_open) (const char *, int); - /* Old targets with a static target vector provide "to_close". - New re-entrant targets provide "to_xclose" and that is expected - to xfree everything (including the "struct target_ops"). */ - void (*to_xclose) (struct target_ops *targ); + + /* Close the target. This is where the target can handle + teardown. Heap-allocated targets should delete themselves + before returning. */ void (*to_close) (struct target_ops *); + /* Attaches to a process on the target side. Arguments are as passed to the `attach' command by the user. This routine can be called when the target is not on the target-stack, if the |