aboutsummaryrefslogtreecommitdiff
path: root/gdb/linux-nat.h
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2011-09-09 19:27:50 +0000
committerPedro Alves <palves@redhat.com>2011-09-09 19:27:50 +0000
commit25289eb274bff1f2052ecea034171ff2b6970c94 (patch)
tree12d16820d3646403134db7e8904463316ae897f5 /gdb/linux-nat.h
parentf687d035648db21290f4528e84713c8d9d2fde19 (diff)
downloadgdb-25289eb274bff1f2052ecea034171ff2b6970c94.zip
gdb-25289eb274bff1f2052ecea034171ff2b6970c94.tar.gz
gdb-25289eb274bff1f2052ecea034171ff2b6970c94.tar.bz2
2011-09-09 Pedro Alves <pedro@codesourcery.com>
* linux-nat.h (enum resume_kind): New. (struct lwp_info) <last_resume_kind>: New field. (linux_child_follow_fork): Set last_resume_kind to resume_stop on the new lwp. (add_lwp): Set last_resume_kind as resume_continue by default. (lin_lwp_attach_lwp): Set last_resume_kind as resume_stop. (resume_lwp): New, factored out from resume_callback. Also check for pending status in lp->waitstatus. (resume_callback): Reimplement. (resume_clear_callback): Set last_resume_kind as resume_stop. (resume_set_callback): Set last_resume_kind as resume_continue. (linux_nat_resume, linux_handle_extended_wait): Set last_resume_kind. (running_callback): Also check lp->waitstatus for pending events. (select_singlestep_lwp_callback): Check that lp->last_resume_kind is resume_step. (stop_and_resume_callback): Don't re-resume if the core wanted the lwp stopped. Use resume_lwp instead of resume_callback. Avoid using an invalidated pointer. (linux_nat_filter_event): Don't discard SIGSTOPs as delayed SIGSTOPs if the core wanted the LWP to stop. (linux_nat_wait_1) Don't consume a pending SIGSTOP if the core wanted the lwp to stop. If the core wanted the lwp to stop, and the lwp stopped with a SIGSTOP, report a TARGET_SIGNAL_0 instead of TARGET_SIGNAL_STOP. (linux_nat_stop_lwp): Don't synchronously wait for the lwp to stop here. Instead, signal the lwp, and set the last_resume_kind to resume_stop.
Diffstat (limited to 'gdb/linux-nat.h')
-rw-r--r--gdb/linux-nat.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/gdb/linux-nat.h b/gdb/linux-nat.h
index 12fda0f..6175f3a 100644
--- a/gdb/linux-nat.h
+++ b/gdb/linux-nat.h
@@ -22,6 +22,20 @@
#include <signal.h>
+/* Ways to "resume" a thread. */
+
+enum resume_kind
+{
+ /* Thread should continue. */
+ resume_continue,
+
+ /* Thread should single-step. */
+ resume_step,
+
+ /* Thread should be stopped. */
+ resume_stop
+};
+
/* Structure describing an LWP. This is public only for the purposes
of ALL_LWPS; target-specific code should generally not access it
directly. */
@@ -52,6 +66,9 @@ struct lwp_info
didn't try to let the LWP run. */
int resumed;
+ /* The last resume GDB requested on this thread. */
+ enum resume_kind last_resume_kind;
+
/* If non-zero, a pending wait status. */
int status;