This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFA] gdbserver handle_extended_wait
- From: Michael Snyder <msnyder at vmware dot com>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Wed, 17 Mar 2010 12:58:16 -0700
- Subject: [RFA] gdbserver handle_extended_wait
We shouldn't continue out of the loop unles the event is actually handled.
2010-03-17 Michael Snyder <msnyder@vmware.com>
* linux-low.c (handle_extended_wait): Return 1 if handled,
else return 0.
(linux_wait_for_event_1): After calling handle_extended_wait,
only continue if the event has been handled.
Index: linux-low.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/linux-low.c,v
retrieving revision 1.133
diff -u -p -r1.133 linux-low.c
--- linux-low.c 15 Mar 2010 00:31:16 -0000 1.133
+++ linux-low.c 17 Mar 2010 19:30:22 -0000
@@ -354,9 +354,11 @@ my_waitpid (int pid, int *status, int fl
/* Handle a GNU/Linux extended wait response. If we see a clone
event, we need to add the new LWP to our list (and not report the
- trap to higher layers). */
+ trap to higher layers).
-static void
+ Return TRUE if handled, else return FALSE. */
+
+static int
handle_extended_wait (struct lwp_info *event_child, int wstat)
{
int event = wstat >> 16;
@@ -424,7 +426,9 @@ handle_extended_wait (struct lwp_info *e
threads, it will have a pending SIGSTOP; we may as well
collect it now. */
linux_resume_one_lwp (event_child, event_child->stepping, 0, NULL);
+ return 1; /* Extended wait was handled. */
}
+ return 0; /* Not handled. */
}
/* This function should only be called if the process got a SIGTRAP.
@@ -1250,8 +1254,8 @@ linux_wait_for_event_1 (ptid_t ptid, int
if (WIFSTOPPED (*wstat) && WSTOPSIG (*wstat) == SIGTRAP
&& *wstat >> 16 != 0)
{
- handle_extended_wait (event_child, *wstat);
- continue;
+ if (handle_extended_wait (event_child, *wstat))
+ continue;
}
/* If GDB is not interested in this signal, don't stop other