[Lldb-commits] [lldb] 00559c2 - [lldb][windows] Keep int3 breakpoints inside the debugger on lldb-server (#197669)

via lldb-commits lldb-commits at lists.llvm.org
Thu May 14 07:54:21 PDT 2026


Author: Charles Zablit
Date: 2026-05-14T16:54:15+02:00
New Revision: 00559c249a8c6aa4d0746839da312ced5031dce6

URL: https://github.com/llvm/llvm-project/commit/00559c249a8c6aa4d0746839da312ced5031dce6
DIFF: https://github.com/llvm/llvm-project/commit/00559c249a8c6aa4d0746839da312ced5031dce6.diff

LOG: [lldb][windows] Keep int3 breakpoints inside the debugger on lldb-server (#197669)

Added: 
    

Modified: 
    lldb/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp b/lldb/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp
index c5698b1a8368d..4fdb286c93e1e 100644
--- a/lldb/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp
+++ b/lldb/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp
@@ -564,7 +564,20 @@ NativeProcessWindows::OnDebugException(bool first_chance,
       return ExceptionResult::BreakInDebugger;
     }
 
-    [[fallthrough]];
+    {
+      // Any remaining STATUS_BREAKPOINT is a breakpoint instruction in the
+      // program's own code (e.g. `__debugbreak()` or `__builtin_debugtrap()`).
+      // Stop the debugger and let the user decide what to do.
+      std::string desc =
+          formatv("Exception {0:x8} encountered at address {1:x8}",
+                  record.GetExceptionCode(), record.GetExceptionAddress())
+              .str();
+      StopThread(record.GetThreadID(), StopReason::eStopReasonException,
+                 std::move(desc));
+      SetState(eStateStopped, true);
+    }
+
+    return ExceptionResult::MaskException;
   default:
     LLDB_LOG(log,
              "Debugger thread reported exception {0:x} at address {1:x} "


        


More information about the lldb-commits mailing list