aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbthread.h
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2015-08-07 17:23:57 +0100
committerPedro Alves <palves@redhat.com>2015-08-07 17:23:57 +0100
commitc2829269f5af8a860b54ceac3596610b1f51fee5 (patch)
tree83f1eb93f9a22910a95b423efa93429199b8d74d /gdb/gdbthread.h
parent6c4cfb244b408f980be24ea2175bc58baf74a6f9 (diff)
downloadfsf-binutils-gdb-c2829269f5af8a860b54ceac3596610b1f51fee5.zip
fsf-binutils-gdb-c2829269f5af8a860b54ceac3596610b1f51fee5.tar.gz
fsf-binutils-gdb-c2829269f5af8a860b54ceac3596610b1f51fee5.tar.bz2
Embed the pending step-over chain in thread_info objects
In order to teach non-stop mode to do in-line step-overs (pause all threads, remove breakpoint, single-step, reinsert breakpoint, restart threads), we'll need to be able to queue in-line step over requests, much like we queue displaced stepping (out-of-line) requests. Actually, the queue should be the same -- threads wait for their turn to step past something (breakpoint, watchpoint), doesn't matter what technique we end up using when the step over actually starts. I found that the queue management ends up simpler and more efficient if embedded in the thread objects themselves. This commit converts the existing displaced stepping queue to that. Later patches will make the in-line step-overs code paths use it too. gdb/ChangeLog: 2015-08-07 Pedro Alves <palves@redhat.com> * gdbthread.h (struct thread_info) <step_over_prev, step_over_next>: New fields. (thread_step_over_chain_enqueue, thread_step_over_chain_remove) (thread_step_over_chain_next, thread_is_in_step_over_chain): New declarations. * infrun.c (struct displaced_step_request): Delete. (struct displaced_step_inferior_state) <step_request_queue>: Delete field. (displaced_step_prepare): Assert that trap_expected is set. Use thread_step_over_chain_enqueue. Split starting a new displaced step to ... (start_step_over): ... this new function. (resume): Assert the thread isn't waiting for a step over already. (proceed): Assert the thread isn't waiting for a step over already. (infrun_thread_stop_requested): Adjust to remove threads from the embedded step-over chain. (handle_inferior_event) <fork/vfork>: Call start_step_over after displaced_step_fixup. (handle_signal_stop): Call start_step_over after displaced_step_fixup. * infrun.h (step_over_queue_head): New declaration. * thread.c (step_over_chain_enqueue, step_over_chain_remove) (thread_step_over_chain_next, thread_is_in_step_over_chain) (thread_step_over_chain_enqueue) (thread_step_over_chain_remove): New functions. (delete_thread_1): Remove thread from the step-over chain.
Diffstat (limited to 'gdb/gdbthread.h')
-rw-r--r--gdb/gdbthread.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h
index fefad48..2602e8b 100644
--- a/gdb/gdbthread.h
+++ b/gdb/gdbthread.h
@@ -283,6 +283,12 @@ struct thread_info
/* Values that are stored as temporaries on stack while evaluating
expressions. */
value_vec *stack_temporaries;
+
+ /* Step-over chain. A thread is in the step-over queue if these are
+ non-NULL. If only a single thread is in the chain, then these
+ fields point to self. */
+ struct thread_info *step_over_prev;
+ struct thread_info *step_over_next;
};
/* Create an empty thread list, or empty the existing one. */
@@ -500,6 +506,23 @@ extern struct value *get_last_thread_stack_temporary (ptid_t);
extern int value_in_thread_stack_temporaries (struct value *, ptid_t);
+/* Add TP to the end of its inferior's pending step-over chain. */
+
+extern void thread_step_over_chain_enqueue (struct thread_info *tp);
+
+/* Remove TP from its inferior's pending step-over chain. */
+
+extern void thread_step_over_chain_remove (struct thread_info *tp);
+
+/* Return the next thread in the step-over chain starting at TP. NULL
+ if TP is the last entry in the chain. */
+
+extern struct thread_info *thread_step_over_chain_next (struct thread_info *tp);
+
+/* Return true if TP is in the step-over chain. */
+
+extern int thread_is_in_step_over_chain (struct thread_info *tp);
+
extern struct thread_info *thread_list;
#endif /* GDBTHREAD_H */