Export the watchpoint related API (SBWatchpointLocation class and added SBTarget methods)
to the Python interface.

Implement yet another (threre're 3 now) iterator protocol for SBTarget: watchpoint_location_iter(),
to iterate on the available watchpoint locations.  And add a print representation for
SBWatchpointLocation.

Exercise some of these Python API with TestWatchpointLocationIter.py.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@140595 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBWatchpointLocation.cpp b/source/API/SBWatchpointLocation.cpp
index b0e3eb8..33b035f 100644
--- a/source/API/SBWatchpointLocation.cpp
+++ b/source/API/SBWatchpointLocation.cpp
@@ -63,12 +63,46 @@
 {
 }
 
+watch_id_t
+SBWatchpointLocation::GetID () const
+{
+    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+
+    watch_id_t watch_id = LLDB_INVALID_WATCH_ID;
+    if (m_opaque_sp)
+        watch_id = m_opaque_sp->GetID();
+
+    if (log)
+    {
+        if (watch_id == LLDB_INVALID_WATCH_ID)
+            log->Printf ("SBWatchpointLocation(%p)::GetID () => LLDB_INVALID_WATCH_ID", m_opaque_sp.get());
+        else
+            log->Printf ("SBWatchpointLocation(%p)::GetID () => %u", m_opaque_sp.get(), watch_id);
+    }
+
+    return watch_id;
+}
+
 bool
 SBWatchpointLocation::IsValid() const
 {
     return m_opaque_sp.get() != NULL;
 }
 
+int32_t
+SBWatchpointLocation::GetHardwareIndex () const
+{
+    int32_t hw_index = -1;
+
+    if (m_opaque_sp)
+    {
+        Mutex::Locker api_locker (m_opaque_sp->GetTarget().GetAPIMutex());
+        hw_index = m_opaque_sp->GetHardwareIndex();
+    }
+
+    return hw_index;
+}
+
 addr_t
 SBWatchpointLocation::GetWatchAddress () const
 {
@@ -103,7 +137,7 @@
     if (m_opaque_sp)
     {
         Mutex::Locker api_locker (m_opaque_sp->GetTarget().GetAPIMutex());
-        m_opaque_sp->SetEnabled (enabled);
+        m_opaque_sp->GetTarget().DisableWatchpointLocationByID(m_opaque_sp->GetID());
     }
 }
 
@@ -120,6 +154,23 @@
 }
 
 uint32_t
+SBWatchpointLocation::GetHitCount () const
+{
+    uint32_t count = 0;
+    if (m_opaque_sp)
+    {
+        Mutex::Locker api_locker (m_opaque_sp->GetTarget().GetAPIMutex());
+        count = m_opaque_sp->GetHitCount();
+    }
+
+    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    if (log)
+        log->Printf ("SBWatchpointLocation(%p)::GetHitCount () => %u", m_opaque_sp.get(), count);
+
+    return count;
+}
+
+uint32_t
 SBWatchpointLocation::GetIgnoreCount ()
 {
     if (m_opaque_sp)