When calculating the "currently selected thread" in
authorJim Ingham <jingham@apple.com>
Tue, 27 Jul 2021 20:33:49 +0000 (13:33 -0700)
committerJim Ingham <jingham@apple.com>
Tue, 27 Jul 2021 20:38:09 +0000 (13:38 -0700)
commit910353c1048e5efac64b639a65b4d968aba3aa81
tree619dcf70c55179d24fb20a9fc66e2448a90d379a
parent0018c7123be3e090ba546fb730ed316fa2567655
When calculating the "currently selected thread" in
Process::HandleStateChangedEvent, we check whether a thread stopped
for eStopReasonSignal is stopped for a signal that's currently set to
"no-stop". If it is, then we don't set that thread as the currently
selected thread.

But that only happens in the part of the algorithm that's handling the
case where the previously selected thread has no stop reason. Since we
want to keep on a thread as long as it is doing something interesting,
we always prefer the current thread. That's almost right, but we
forgot to check whether the previously selected thread stopped with an
eStopReasonSignal for a "no-stop" signal. If it did, then we shouldn't
select it.

This patch adds that check. I can't figure out a good way to test
this. This is the sort of thing that Ismail's scripted process plugin
will make easy once it is a real boy. But figuring out how to do this
in a real process is not trivial.

Differential Revision: https://reviews.llvm.org/D106712
lldb/source/Target/Process.cpp