+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.
+
2018-05-02 Pedro Alves <palves@redhat.com>
* alpha-linux-nat.c: Include "linux-nat-trad.h" instead of
}
static void
-target_bfd_xclose (struct target_ops *t)
+target_bfd_close (struct target_ops *t)
{
struct target_bfd_data *data = (struct target_bfd_data *) t->to_data;
t->to_doc = _("You should never see this");
t->to_get_section_table = target_bfd_get_section_table;
t->to_xfer_partial = target_bfd_xfer_partial;
- t->to_xclose = target_bfd_xclose;
+ t->to_close = target_bfd_close;
t->to_data = data;
t->to_magic = OPS_MAGIC;
fileio_handles_invalidate_target (targ);
- if (targ->to_xclose != NULL)
- targ->to_xclose (targ);
- else if (targ->to_close != NULL)
+ if (targ->to_close != NULL)
targ->to_close (targ);
if (targetdebug)
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