* linux-low.c (linux_wait_for_event): Improve comment.
(linux_wait_1): Keep current_inferior in sync with event_child.
+2014-02-05 Doug Evans <dje@google.com>
+
+ * linux-low.c (linux_wait_for_event): Improve comment.
+ (linux_wait_1): Keep current_inferior in sync with event_child.
+
2014-01-22 Doug Evans <dje@google.com>
* gdbthread.h (gdb_id_to_thread): Delete, unused.
2014-01-22 Doug Evans <dje@google.com>
* gdbthread.h (gdb_id_to_thread): Delete, unused.
child. Store the stop status through the status pointer WSTAT.
OPTIONS is passed to the waitpid call. Return 0 if no child stop
event was found and OPTIONS contains WNOHANG. Return the PID of
child. Store the stop status through the status pointer WSTAT.
OPTIONS is passed to the waitpid call. Return 0 if no child stop
event was found and OPTIONS contains WNOHANG. Return the PID of
- the stopped child otherwise. */
+ the stopped child and update current_inferior otherwise. */
static int
linux_wait_for_event (ptid_t ptid, int *wstat, int options)
static int
linux_wait_for_event (ptid_t ptid, int *wstat, int options)
select_event_lwp (&event_child);
select_event_lwp (&event_child);
+ /* current_inferior and event_child must stay in sync. */
+ current_inferior = get_lwp_thread (event_child);
+
event_child->status_pending_p = 0;
w = event_child->status_pending;
}
event_child->status_pending_p = 0;
w = event_child->status_pending;
}