================
@@ -492,23 +492,36 @@ NativeProcessWindows::OnDebugException(bool first_chance,
}
case DWORD(STATUS_BREAKPOINT):
case STATUS_WX86_BREAKPOINT:
- if (FindSoftwareBreakpoint(record.GetExceptionAddress())) {
- LLDB_LOG(log, "Hit non-loader breakpoint at address {0:x}.",
- record.GetExceptionAddress());
-
- StopThread(record.GetThreadID(), StopReason::eStopReasonBreakpoint);
- if (NativeThreadWindows *stop_thread =
- GetThreadByID(record.GetThreadID())) {
- auto ®ister_context = stop_thread->GetRegisterContext();
- uint32_t breakpoint_size = GetSoftwareBreakpointPCOffset();
- // The current PC is AFTER the BP opcode, on all architectures.
- uint64_t pc = register_context.GetPC() - breakpoint_size;
- register_context.SetPC(pc);
+ if (NativeThreadWindows *stop_thread =
+ GetThreadByID(record.GetThreadID())) {
+ auto ®_ctx = stop_thread->GetRegisterContext();
+ const auto exception_addr = record.GetExceptionAddress();
+ const auto thread_id = record.GetThreadID();
+
+ if (FindSoftwareBreakpoint(exception_addr)) {
+ LLDB_LOG(log, "Hit non-loader breakpoint at address {0:x}.",
----------------
omjavaid wrote:
"loader breakpoint" as its often called is a system generated breakpoint on
executable startup. Loader is Somewhat in similar sequence to how dynamic
linker does loading on linux. But on windows system first breakpoint event is
something like PTRACE_EVENT_EXEC event. We handle the initial loader breakpoint
below in the same function at `if (!initial_stop) {`
https://github.com/llvm/llvm-project/pull/108072
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits