================
@@ -293,8 +297,12 @@ Status ProcessWindows::DoDestroy() {
 
 Status ProcessWindows::DoHalt(bool &caused_stop) {
   StateType state = GetPrivateState();
-  if (state != eStateStopped)
-    return HaltProcess(caused_stop);
+  if (state != eStateStopped) {
+    m_pending_halt = true;
----------------
charles-zablit wrote:

On Windows there's no SIGSTOP to pause a debuggee. To pause a running process 
from the debugger `DebugBreakProcess()` is used. It works by injecting a new 
thread into the target process that executes an `int3` instruction. The `int3` 
causes an `EXCEPTION_BREAKPOINT`.

`EXCEPTION_BREAKPOINT` is ambiguous because it can mean either of the 
following, without side data to differentiate them:

- Did the debuggee hit a breakpoint lldb set?: real stop, report it.
- Is this the loader's startup int3?: ignore it.
- Is this the artificial int3 lldb just injected to implement `Halt/Interrupt`? 
it's not a "real" breakpoint at all, ignore it.

`m_expecting_loader_int3` resolves the 2nd case.
`m_pending_halt` resolves the 3rd case.

https://github.com/llvm/llvm-project/pull/208233
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to