[Lldb-commits] [lldb] [lldb] Add pc check for thread-step-by-bp algorithms (PR #108504)
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Fri Sep 13 04:07:37 PDT 2024
labath wrote:
It can happen through timing, but also in single-threaded code as well. A thread could reach-but-not execute a breakpoint insn due to some activity on the previous insn. E.g. it could be single-stepping over it (so the stop reason is "i've completed a step", not "I've hit a breakpoint"), or (on x86, where watchpoint hits are reported after the fact), the previous insn could have triggered a watchpoint.
None of this really matters for this patch though. The problem here was that the lldb-server implementation has assuming that the stop reason of a software-single-stepping thread *must* be "i've completed a step" , but that won't be the case if the instruction you are stepping over is actually a breakpoint insn -- in that case, the reason will be "i've hit a breakpoint (other than the temporary bkpt i've set to single-step)". It just so happens that without that Jason's patch, lldb would never actually try to step over a breakpoint insn it knew of, so we'd never hit this problem.
https://github.com/llvm/llvm-project/pull/108504
More information about the lldb-commits
mailing list