From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6747 invoked by alias); 27 Oct 2008 22:38:19 -0000 Received: (qmail 6737 invoked by uid 22791); 27 Oct 2008 22:38:18 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 27 Oct 2008 22:37:43 +0000 Received: (qmail 28874 invoked from network); 27 Oct 2008 22:37:41 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 27 Oct 2008 22:37:41 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: Allow attaching to multiple processes Date: Mon, 27 Oct 2008 23:29:00 -0000 User-Agent: KMail/1.9.9 References: <200810271244.06188.pedro@codesourcery.com> In-Reply-To: <200810271244.06188.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_ILkBJ0YD6QMAODm" Message-Id: <200810272238.00037.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-10/txt/msg00668.txt.bz2 --Boundary-00=_ILkBJ0YD6QMAODm Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-length: 446 On Monday 27 October 2008 12:44:05, Pedro Alves wrote: > Now that the remote target supports debugging multiple inferiors > simultaneously, we need to allow/expose that to the command level. This > patch allows "attach"ing to multiple processes. ("run"ning will come later). > > Not much rocket science here --- the comments/code should be > self-explanatory. "kill" requires a similar treatment, like attached. Checked in. -- Pedro Alves --Boundary-00=_ILkBJ0YD6QMAODm Content-Type: text/x-diff; charset="utf-8"; name="kill_theres_execution.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="kill_theres_execution.diff" Content-length: 1437 2008-10-27 Pedro Alves * inflow.c (kill_command): If the target claims there is still execution, don't clear the thread list. --- gdb/inflow.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) Index: src/gdb/inflow.c =================================================================== --- src.orig/gdb/inflow.c 2008-10-27 20:38:52.000000000 +0000 +++ src/gdb/inflow.c 2008-10-27 22:31:15.000000000 +0000 @@ -601,14 +601,19 @@ kill_command (char *arg, int from_tty) error (_("Not confirmed.")); target_kill (); - init_thread_list (); /* Destroy thread info */ - - /* Killing off the inferior can leave us with a core file. If so, - print the state we are left in. */ - if (target_has_stack) - { - printf_filtered (_("In %s,\n"), target_longname); - print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC); + /* 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 (); /* Destroy thread info */ + + /* Killing off the inferior can leave us with a core file. If + so, print the state we are left in. */ + if (target_has_stack) + { + printf_filtered (_("In %s,\n"), target_longname); + print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC); + } } bfd_cache_close_all (); } --Boundary-00=_ILkBJ0YD6QMAODm--