forked from Imagelibrary/binutils-gdb
* 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:
12
gdb/infcmd.c
12
gdb/infcmd.c
@@ -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 ();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user