* target.h (struct target_ops) <to_supports_multi_process>: New

field.
	(target_supports_multi_process): New define.
	* target.c (update_current_target): Inherit and de_fault
	to_supports_multi_process.
	* infcmd.c (attach_command): Allow attaching to multiple processes
	if the target supports it.
	(detach_command): If the target claims there is still execution,
	don't clear the thread list.
	* remote.c (remote_supports_multi_process): New.
	(init_remote_ops): Register remote_supports_multi_process.
This commit is contained in:
Pedro Alves
2008-10-27 12:43:24 +00:00
parent 676e87b308
commit 8a30517206
5 changed files with 46 additions and 2 deletions

View File

@@ -2201,7 +2201,10 @@ attach_command (char *args, int from_tty)
dont_repeat (); /* Not for the faint of heart */
if (target_has_execution)
if (target_supports_multi_process ())
/* Don't complain if we can be attached to multiple processes. */
;
else if (target_has_execution)
{
if (query ("A program is being debugged already. Kill it? "))
target_kill ();
@@ -2311,7 +2314,12 @@ detach_command (char *args, int from_tty)
dont_repeat (); /* Not for the faint of heart. */
target_detach (args, from_tty);
no_shared_libraries (NULL, from_tty);
init_thread_list ();
/* If the current target interface claims there's still execution,
then don't mess with threads of other processes. */
if (!target_has_execution)
init_thread_list ();
if (deprecated_detach_hook)
deprecated_detach_hook ();
}