convert to_detach

2014-02-19  Tom Tromey  <tromey@redhat.com>

	* target-delegates.c: Rebuild.
	* target.c (target_detach): Unconditionally delegate.
	(init_dummy_target): Don't initialize to_detach.
	* target.h (struct target_ops) <to_detach>: Use
	TARGET_DEFAULT_IGNORE.
This commit is contained in:
Tom Tromey 2013-12-13 13:33:08 -07:00
parent 5436ff0304
commit 09da0d0ae7
4 changed files with 29 additions and 16 deletions

View file

@ -2690,19 +2690,10 @@ target_detach (const char *args, int from_tty)
prepare_for_detach ();
for (t = current_target.beneath; t != NULL; t = t->beneath)
{
if (t->to_detach != NULL)
{
t->to_detach (t, args, from_tty);
if (targetdebug)
fprintf_unfiltered (gdb_stdlog, "target_detach (%s, %d)\n",
args, from_tty);
return;
}
}
internal_error (__FILE__, __LINE__, _("could not find a target to detach"));
current_target.to_detach (&current_target, args, from_tty);
if (targetdebug)
fprintf_unfiltered (gdb_stdlog, "target_detach (%s, %d)\n",
args, from_tty);
}
void
@ -3816,8 +3807,6 @@ init_dummy_target (void)
dummy_target.to_longname = "None";
dummy_target.to_doc = "";
dummy_target.to_attach = find_default_attach;
dummy_target.to_detach =
(void (*)(struct target_ops *, const char *, int))target_ignore;
dummy_target.to_create_inferior = find_default_create_inferior;
dummy_target.to_supports_non_stop = find_default_supports_non_stop;
dummy_target.to_supports_disable_randomization