[Lldb-commits] [lldb] r139315 - in /lldb/trunk: include/lldb/Breakpoint/WatchpointLocationList.h include/lldb/Target/Target.h source/Plugins/Process/Utility/StopInfoMachException.cpp

Johnny Chen johnny.chen at apple.com
Thu Sep 8 13:52:34 PDT 2011


Author: johnny
Date: Thu Sep  8 15:52:34 2011
New Revision: 139315

URL: http://llvm.org/viewvc/llvm-project?rev=139315&view=rev
Log:
Watchpoint WIP: on the debugger side, create an instance of either
StopInfoTrace or StopInfoWatchpoint based on the exc_sub_code, as well.

Modified:
    lldb/trunk/include/lldb/Breakpoint/WatchpointLocationList.h
    lldb/trunk/include/lldb/Target/Target.h
    lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.cpp

Modified: lldb/trunk/include/lldb/Breakpoint/WatchpointLocationList.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Breakpoint/WatchpointLocationList.h?rev=139315&r1=139314&r2=139315&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Breakpoint/WatchpointLocationList.h (original)
+++ lldb/trunk/include/lldb/Breakpoint/WatchpointLocationList.h Thu Sep  8 15:52:34 2011
@@ -19,6 +19,7 @@
 #include "lldb/lldb-private.h"
 #include "lldb/Core/Address.h"
 #include "lldb/Host/Mutex.h"
+#include "lldb/Breakpoint/WatchpointLocation.h"
 
 namespace lldb_private {
 

Modified: lldb/trunk/include/lldb/Target/Target.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Target.h?rev=139315&r1=139314&r2=139315&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Target.h (original)
+++ lldb/trunk/include/lldb/Target/Target.h Thu Sep  8 15:52:34 2011
@@ -279,6 +279,12 @@
                       lldb::BreakpointResolverSP &resolver_sp,
                       bool internal = false);
 
+    WatchpointLocationList &
+    GetWatchpointLocationList()
+    {
+        return m_watchpoint_location_list;
+    }
+
     void
     RemoveAllBreakpoints (bool internal_also = false);
 

Modified: lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.cpp?rev=139315&r1=139314&r2=139315&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.cpp Thu Sep  8 15:52:34 2011
@@ -299,7 +299,14 @@
                 case llvm::Triple::x86_64:
                     if (exc_code == 1) // EXC_I386_SGL
                     {
-                        return StopInfo::CreateStopReasonToTrace(thread);
+                        if (!exc_sub_code)
+                            return StopInfo::CreateStopReasonToTrace(thread);
+
+                        // It's a watchpoint, then.
+                        lldb::WatchpointLocationSP wp_loc_sp =
+                            thread.GetProcess().GetTarget().GetWatchpointLocationList().FindByAddress((lldb::addr_t)exc_sub_code);
+                        if (wp_loc_sp)
+                            return StopInfo::CreateStopReasonWithWatchpointID(thread, wp_loc_sp->GetID());
                     }
                     else if (exc_code == 2) // EXC_I386_BPT
                     {





More information about the lldb-commits mailing list