diff options
author | Pedro Alves <palves@redhat.com> | 2008-10-27 12:43:24 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2008-10-27 12:43:24 +0000 |
commit | 8a305172062baab75e6a3c61c971153558245551 (patch) | |
tree | 9e396af11e2e0a3f87b003c6f154a7c518fd7414 /gdb/infcmd.c | |
parent | 676e87b3082eb253c4b3b7b2ce4ab4f3b241980d (diff) | |
download | gdb-8a305172062baab75e6a3c61c971153558245551.zip gdb-8a305172062baab75e6a3c61c971153558245551.tar.gz gdb-8a305172062baab75e6a3c61c971153558245551.tar.bz2 |
* 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.
Diffstat (limited to 'gdb/infcmd.c')
-rw-r--r-- | gdb/infcmd.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 1854985..28ce813 100644 --- a/gdb/infcmd.c +++ b/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 (); } |