Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* linux native, switch forks, always have a thread
@ 2008-04-30 16:42 Pedro Alves
  2008-04-30 21:26 ` Michael Snyder
  2008-05-01 20:36 ` Daniel Jacobowitz
  0 siblings, 2 replies; 4+ messages in thread
From: Pedro Alves @ 2008-04-30 16:42 UTC (permalink / raw)
  To: gdb-patches

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

I'd missed this case when I made linux native always have a thread.

It's not perfect in the sense that switching forks ("restart"/"fork",
not follow-fork-mode) in multi-threaded apps doesn't handle
multi-threading correctly yet, but that is an already existing
problem.  We shall be getting back to that in a few weeks
for multi-process support.

-- 
Pedro Alves

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

2008-04-30  Pedro Alves  <pedro@codesourcery.com>

	* linux-nat.c (linux_nat_switch_fork): Reinit GDB's thread list
	and register the fork's PTID as a thread.

---
 gdb/linux-nat.c |    2 ++
 1 file changed, 2 insertions(+)

Index: src/gdb/linux-nat.c
===================================================================
--- src.orig/gdb/linux-nat.c	2008-04-28 11:54:27.000000000 +0100
+++ src/gdb/linux-nat.c	2008-04-28 11:53:38.000000000 +0100
@@ -948,8 +948,10 @@ linux_nat_switch_fork (ptid_t new_ptid)
 {
   struct lwp_info *lp;
 
+  init_thread_list ();
   init_lwp_list ();
   lp = add_lwp (new_ptid);
+  add_thread_silent (new_ptid);
   lp->stopped = 1;
 }
 

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

end of thread, other threads:[~2008-05-01 22:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-30 16:42 linux native, switch forks, always have a thread Pedro Alves
2008-04-30 21:26 ` Michael Snyder
2008-05-01 20:36 ` Daniel Jacobowitz
2008-05-01 22:52   ` Pedro Alves

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