aboutsummaryrefslogtreecommitdiff
path: root/gdb/infrun.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/infrun.h
parent6c4cfb244b408f980be24ea2175bc58baf74a6f9 (diff)
downloadgdb-c2829269f5af8a860b54ceac3596610b1f51fee5.zip
gdb-c2829269f5af8a860b54ceac3596610b1f51fee5.tar.gz
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/infrun.h')
-rw-r--r--gdb/infrun.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/infrun.h b/gdb/infrun.h
index 75bb075..7d1033c 100644
--- a/gdb/infrun.h
+++ b/gdb/infrun.h
@@ -189,4 +189,8 @@ extern void signal_catch_update (const unsigned int *);
systems. Use of symbolic signal names is strongly encouraged. */
enum gdb_signal gdb_signal_from_command (int num);
+/* The global queue of threads that need to do a step-over operation
+ to get past e.g., a breakpoint. */
+extern struct thread_info *step_over_queue_head;
+
#endif /* INFRUN_H */