summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Roberts <nickrob@snap.net.nz>2006-09-17 12:28:19 +0000
committerNick Roberts <nickrob@snap.net.nz>2006-09-17 12:28:19 +0000
commit2e1349029dad10a4f5f36e9f57d42ed8e865212c (patch)
tree560eb77de088422dc666155fb2c67b1b79956fd4
parente2b9cc82508f16bd9c6e524736c9163968a68ef7 (diff)
downloadgdb-2e1349029dad10a4f5f36e9f57d42ed8e865212c.tar.gz
(linux_nat_resume): Call to_resume method later.
-rw-r--r--gdb/linux-nat.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index 4efe16578a7..a177fb130a5 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -1254,10 +1254,13 @@ linux_nat_resume (ptid_t ptid, int step, enum target_signal signo)
if (resume_all)
iterate_over_lwps (resume_callback, NULL);
- linux_ops->to_resume (ptid, step, signo);
-
if (target_can_async_p ())
{
+ /* Check for pending events. If we find any, then we won't really
+ resume, but rather we will extract the first event from the pending events
+ queue, and post it to the gdb event queue, and then "pretend" that we have
+ in fact resumed. */
+
status.kind = TARGET_WAITKIND_SPURIOUS;
gdb_process_events (gdb_status, &status, 0, 0);
@@ -1268,9 +1271,12 @@ linux_nat_resume (ptid_t ptid, int step, enum target_signal signo)
target_executing = 1;
return;
}
+ }
+
+ linux_ops->to_resume (ptid, step, signo);
+ if (target_can_async_p ())
target_async (inferior_event_handler, 0);
- }
if (target_is_async_p ())
target_executing = 1;
@@ -1917,7 +1923,9 @@ linux_nat_wait (ptid_t ptid, struct target_waitstatus *ourstatus,
if ((ourstatus->kind == TARGET_WAITKIND_EXITED)
|| (ourstatus->kind == TARGET_WAITKIND_SIGNALLED))
- return null_ptid;
+ {
+ return null_ptid;
+ }
return BUILD_LWP (gdb_status->pid, gdb_status->pid);
}