This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] Fix check for resumed threads
- To: gdb-patches at sources dot redhat dot com
- Subject: [PATCH] Fix check for resumed threads
- From: Mark Kettenis <kettenis at wins dot uva dot nl>
- Date: Fri, 13 Jul 2001 14:52:51 +0200
- CC: ken at believe dot com
lin_lwp_wait() may be called when the list of LWPs is still empty
(this will add the LWP for which we receive an event to the list
automatically. This happens when debugging a statically linked
program.
Thanks to Ken Whaley for reporting this.
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* lin-lwp.c (lin_lwp_wait): Avoid check for resumed LWPs if there
are no registered LWPs yet.
Index: lin-lwp.c
===================================================================
RCS file: /cvs/src/src/gdb/lin-lwp.c,v
retrieving revision 1.28
diff -u -p -r1.28 lin-lwp.c
--- lin-lwp.c 2001/07/12 19:37:36 1.28
+++ lin-lwp.c 2001/07/13 12:03:05
@@ -908,8 +908,9 @@ lin_lwp_wait (ptid_t ptid, struct target
retry:
- /* Make sure there is at least one thread that has been resumed. */
- gdb_assert (iterate_over_lwps (resumed_callback, NULL));
+ /* Make sure there is at least one LWP that has been resumed, at
+ least if there are any LWPs at all. */
+ gdb_assert (num_lwps == 0 || iterate_over_lwps (resumed_callback, NULL));
/* First check if there is a LWP with a wait status pending. */
if (pid == -1)