Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] remote doesn't add the main thread if we didn't do so already
@ 2013-02-25 11:01 Hui Zhu
  2013-02-26 12:08 ` Pedro Alves
  0 siblings, 1 reply; 5+ messages in thread
From: Hui Zhu @ 2013-02-25 11:01 UTC (permalink / raw)
  To: gdb-patches; +Cc: Gustavo, Luis

Hi,

This is the patch to change function add_current_inferior_and_thread that doesn't add the main thread if we didn't do so already.

Thanks,
Hui

2013-02-25  Luis Machado  <lgustavo@codesourcery.com>

	* remote.c (add_current_inferior_and_thread): Only add the main
	thread if we didn't do so already.

--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -3316,10 +3316,16 @@ add_current_inferior_and_thread (char *w
        fake_pid_p = 1;
      }
  
-  remote_add_inferior (fake_pid_p, ptid_get_pid (inferior_ptid), -1);
+  /* Only add the main thread if we didn't do so already.  Some
+     targets don't support listing threads, so we need to handle
+     inclusion of the main thread here.  */
+  if (!in_thread_list (inferior_ptid))
+    {
+      remote_add_inferior (fake_pid_p, ptid_get_pid (inferior_ptid), -1);
  
-  /* Add the main thread.  */
-  add_thread_silent (inferior_ptid);
+      /* Add the main thread.  */
+      add_thread_silent (inferior_ptid);
+    }
  }
  
  static void


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-02-27  2:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-25 11:01 [PATCH] remote doesn't add the main thread if we didn't do so already Hui Zhu
2013-02-26 12:08 ` Pedro Alves
2013-02-26 14:40   ` Hui Zhu
2013-02-26 14:49     ` Pedro Alves
2013-02-27  2:00       ` Hui Zhu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox