Module Name:    src
Committed By:   martin
Date:           Sat Feb 16 18:06:44 UTC 2013

Modified Files:
        src/external/gpl3/gdb/dist/gdb: nbsd-thread.c

Log Message:
When searching for an active thread (e.g. right after switching to threaded
mode), if no lwp is signaled, just stay with the current (inferior_ptid.lwp).
This fixes gdb -p to a threaded process with all threads active.
Previously we eroneously restored an lwp of 0 (returned as sentinel from
ptrace) to inferior_ptid.lwp, which then would not match any thread in
thread_list and caused assertion failures.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/external/gpl3/gdb/dist/gdb/nbsd-thread.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/nbsd-thread.c
diff -u src/external/gpl3/gdb/dist/gdb/nbsd-thread.c:1.16 src/external/gpl3/gdb/dist/gdb/nbsd-thread.c:1.17
--- src/external/gpl3/gdb/dist/gdb/nbsd-thread.c:1.16	Sat Apr 21 00:16:35 2012
+++ src/external/gpl3/gdb/dist/gdb/nbsd-thread.c	Sat Feb 16 18:06:43 2013
@@ -282,6 +282,9 @@ find_active_thread (void)
       while ((val != -1) && (pl.pl_lwpid != 0) &&
 	     (pl.pl_event != PL_EVENT_SIGNAL))
 	val = ptrace (PT_LWPINFO, GET_PID(inferior_ptid), (void *)&pl, sizeof(pl));
+      if (pl.pl_lwpid == 0)
+	/* found no "active" thread, stay with current */
+	pl.pl_lwpid = inferior_ptid.lwp;
     }
   else
     {

Reply via email to