[all-commits] [llvm/llvm-project] bd89ac: [lldb][Windows] Remember server's primary stop thr...
Charles Zablit via All-commits
all-commits at lists.llvm.org
Mon Jun 22 09:22:00 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: bd89ac741dff1a6edec15821b719a34ab5646f3f
https://github.com/llvm/llvm-project/commit/bd89ac741dff1a6edec15821b719a34ab5646f3f
Author: Charles Zablit <c_zablit at apple.com>
Date: 2026-06-22 (Mon, 22 Jun 2026)
Changed paths:
M lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
M lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
Log Message:
-----------
[lldb][Windows] Remember server's primary stop thread on gdb-remote stops (#203525)
The client kept the previously-selected thread across stops, ignoring
the primary tid from the server in `T<sig>thread:<tid>`.
On Windows, lldb-server halts the inferior by injecting a thread called
`DbgUiRemoteBreakin` whose only job is to execute an int 3. After an
interrupt, the process has `N+1` threads and the new one is what caused
the stop. The server reports that thread as primary, but the client
ignored it and stayed on whichever thread was selected before. In
`TestExpressionInSyscall` that thread is main, paused just past
`NtDelayExecution`'s syscall with a garbage value in the RSI register.
Evaluating an expression there crashes the JIT trampoline.
This patch makes `ProcessGDBRemote::RefreshStateAfterStop` record the
primary tid from the most recent T-packet's `thread:<tid>` and select it
after applying per thread stop infos.
Fixes `TestBreakpointSetRestart` and `TestExpressionInSyscall` with
LLDB_USE_LLDB_SERVER=1.
rdar://180307914
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list