[Lldb-commits] [lldb] r223498 - Subtract the size of the breakpoint opcode from the PC when getting the bp site.

Zachary Turner zturner at google.com
Fri Dec 5 10:46:14 PST 2014


Author: zturner
Date: Fri Dec  5 12:46:14 2014
New Revision: 223498

URL: http://llvm.org/viewvc/llvm-project?rev=223498&view=rev
Log:
Subtract the size of the breakpoint opcode from the PC when getting the bp site.

Modified:
    lldb/trunk/source/Plugins/Process/Windows/ProcessWindows.cpp

Modified: lldb/trunk/source/Plugins/Process/Windows/ProcessWindows.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/ProcessWindows.cpp?rev=223498&r1=223497&r2=223498&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Windows/ProcessWindows.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Windows/ProcessWindows.cpp Fri Dec  5 12:46:14 2014
@@ -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;





More information about the lldb-commits mailing list