btrace: lock-step
Record btrace's to_wait method picks a single thread to step. When passed
minus_one_ptid, it picks the current thread. All other threads remain where
they are.
Change this to step all resumed threads together, one step at a time, until
the first thread reports an event.
We do delay reporting NO_HISTORY events until there are no other events to
report to prevent threads at the end of their execution history from starving
other threads.
We keep threads at the end of their execution history moving and replaying
until we announce their stop in to_wait. This shouldn't really be user-visible
but its a detail worth mentioning.
Since record btrace's to_resume method also picks only a single thread to
resume, there shouldn't be a difference with the current all-stop.
With non-stop or all-stop on top of non-stop, we will see differences. The
behaviour should be more natural as we're moving all threads.
gdb/
* record-btrace.c: Include vec.h.
(record_btrace_find_thread_to_move): Removed.
(btrace_step_no_resumed, btrace_step_again)
(record_btrace_stop_replaying_at_end): New.
(record_btrace_cancel_resume): Call record_btrace_stop_replaying_at_end.
(record_btrace_single_step_forward): Remove calls to
record_btrace_stop_replaying.
(record_btrace_step_thread): Do only one step for BTHR_CONT and
BTHR_RCONT. Keep threads at the end of their history moving.
(record_btrace_wait): Call record_btrace_step_thread for all threads
until one reports an event. Call record_btrace_stop_replaying_at_end
for the eventing thread.