From 2e1349029dad10a4f5f36e9f57d42ed8e865212c Mon Sep 17 00:00:00 2001 From: Nick Roberts Date: Sun, 17 Sep 2006 12:28:19 +0000 Subject: (linux_nat_resume): Call to_resume method later. --- gdb/linux-nat.c | 16 ++++++++++++---- 1 file 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); } -- cgit v1.2.1