Add missing watchpoint stop info creation logic for arm on the debugger side.

WIP for rdar://problem/9667960

llvm-svn: 153206
diff --git a/lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp b/lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp
index 95be8c5..bc313f7 100644
--- a/lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp
+++ b/lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp
@@ -314,7 +314,7 @@
                         lldb::WatchpointSP wp_sp;
                         if (target)
                             wp_sp = target->GetWatchpointList().FindByAddress((lldb::addr_t)exc_sub_code);
-                        if (wp_sp)
+                        if (wp_sp && wp_sp->IsEnabled())
                         {
                             // Debugserver may piggyback the hardware index of the fired watchpoint in the exception data.
                             // Set the hardware index if that's the case.
@@ -337,6 +337,19 @@
                 case llvm::Triple::arm:
                     if (exc_code == 0x102)
                     {
+                        // It's a watchpoint, then, if the exc_sub_code indicates a known/enabled
+                        // data break address from our watchpoint list.
+                        lldb::WatchpointSP wp_sp;
+                        if (target)
+                            wp_sp = target->GetWatchpointList().FindByAddress((lldb::addr_t)exc_sub_code);
+                        if (wp_sp && wp_sp->IsEnabled())
+                        {
+                            // Debugserver may piggyback the hardware index of the fired watchpoint in the exception data.
+                            // Set the hardware index if that's the case.
+                            if (exc_data_count >=3)
+                                wp_sp->SetHardwareIndex((uint32_t)exc_sub_sub_code);
+                            return StopInfo::CreateStopReasonWithWatchpointID(thread, wp_sp->GetID());
+                        }
                         // EXC_ARM_DA_DEBUG seems to be reused for EXC_BREAKPOINT as well as EXC_BAD_ACCESS
                         return StopInfo::CreateStopReasonToTrace(thread);
                     }