[Lldb-commits] [lldb] [lldb][Windows] handle exception first to keep track of the stop reason (PR #206469)
Charles Zablit via lldb-commits
lldb-commits at lists.llvm.org
Mon Jun 29 05:22:53 PDT 2026
https://github.com/charles-zablit updated https://github.com/llvm/llvm-project/pull/206469
>From de239b8301aba33256aa2a1097efeecc6e2649ba Mon Sep 17 00:00:00 2001
From: Charles Zablit <c_zablit at apple.com>
Date: Mon, 29 Jun 2026 13:16:18 +0100
Subject: [PATCH] [lldb][Windows] handle exception first to keep track of the
stop reason
Co-authored-by: Raphael Isemann <rise at apple.com>
---
.../Windows/Common/NativeProcessWindows.cpp | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/lldb/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp b/lldb/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp
index 889a2e743c07f..ce4fa3d1f0152 100644
--- a/lldb/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp
+++ b/lldb/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp
@@ -653,19 +653,26 @@ NativeProcessWindows::OnDebugException(bool first_chance,
const ExceptionRecord &record) {
llvm::sys::ScopedLock lock(m_mutex);
- // Let the debugger establish the internal status.
- ProcessDebugger::OnDebugException(first_chance, record);
-
+ // Handle the exception first to keep track of the stop reason.
+ ExceptionResult result;
switch (record.GetExceptionValue()) {
case DWORD(STATUS_SINGLE_STEP):
case STATUS_WX86_SINGLE_STEP:
- return HandleSingleStepException(record);
+ result = HandleSingleStepException(record);
+ break;
case DWORD(STATUS_BREAKPOINT):
case STATUS_WX86_BREAKPOINT:
- return HandleBreakpointException(record);
+ result = HandleBreakpointException(record);
+ break;
default:
- return HandleGenericException(first_chance, record);
+ result = HandleGenericException(first_chance, record);
+ break;
}
+
+ // Let the debugger establish the internal status.
+ ProcessDebugger::OnDebugException(first_chance, record);
+
+ return result;
}
void NativeProcessWindows::OnCreateThread(const HostThread &new_thread) {
More information about the lldb-commits
mailing list