From 0a526eb85588fbf9cab4a6f95449651311f367e1 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Fri, 5 Dec 2014 18:46:14 +0000 Subject: [PATCH] Subtract the size of the breakpoint opcode from the PC when getting the bp site. llvm-svn: 223498 --- lldb/source/Plugins/Process/Windows/ProcessWindows.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lldb/source/Plugins/Process/Windows/ProcessWindows.cpp b/lldb/source/Plugins/Process/Windows/ProcessWindows.cpp index 0ab627f..08bf698 100644 --- a/lldb/source/Plugins/Process/Windows/ProcessWindows.cpp +++ b/lldb/source/Plugins/Process/Windows/ProcessWindows.cpp @@ -302,6 +302,10 @@ ProcessWindows::RefreshStateAfterStop() if (active_exception->GetExceptionCode() == EXCEPTION_BREAKPOINT) { uint64_t pc = register_context->GetPC(); + // TODO(zturner): The current EIP is AFTER the BP opcode, which is one byte. So + // to find the breakpoint, move the PC back. A better way to do this is probably + // to ask the Platform how big a breakpoint opcode is. + --pc; BreakpointSiteSP site(GetBreakpointSiteList().FindByAddress(pc)); lldb::break_id_t break_id = LLDB_INVALID_BREAK_ID; bool should_stop = true; -- 2.7.4