Watchpoint WIP: on the debugger side, create an instance of either
StopInfoTrace or StopInfoWatchpoint based on the exc_sub_code, as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139315 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Plugins/Process/Utility/StopInfoMachException.cpp b/source/Plugins/Process/Utility/StopInfoMachException.cpp
index 81c64de..71ec18f 100644
--- a/source/Plugins/Process/Utility/StopInfoMachException.cpp
+++ b/source/Plugins/Process/Utility/StopInfoMachException.cpp
@@ -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
                     {