Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Subject: Re: Allow attaching to multiple processes
Date: Mon, 27 Oct 2008 23:29:00 -0000	[thread overview]
Message-ID: <200810272238.00037.pedro@codesourcery.com> (raw)
In-Reply-To: <200810271244.06188.pedro@codesourcery.com>

[-- Attachment #1: Type: text/plain, Size: 446 bytes --]

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

[-- Attachment #2: kill_theres_execution.diff --]
[-- Type: text/x-diff, Size: 1437 bytes --]

2008-10-27  Pedro Alves  <pedro@codesourcery.com>

	* 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 ();
 }

      reply	other threads:[~2008-10-27 22:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-27 12:44 Pedro Alves
2008-10-27 23:29 ` Pedro Alves [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200810272238.00037.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox