Add a commnad to set a condition for a watchpoint. Example:
watchpoint modify -c 'global==5'
modifies the last created watchpoint so that the condition expression
is evaluated at the stop point to decide whether we should proceed with
the stopping.
Also add SBWatchpont::SetCondition(const char *condition) to set condition
programmatically.
Test cases to come later.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@142227 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBWatchpoint.cpp b/source/API/SBWatchpoint.cpp
index de43364..ec2dc12 100644
--- a/source/API/SBWatchpoint.cpp
+++ b/source/API/SBWatchpoint.cpp
@@ -205,6 +205,27 @@
}
}
+const char *
+SBWatchpoint::GetCondition ()
+{
+ if (m_opaque_sp)
+ {
+ Mutex::Locker api_locker (m_opaque_sp->GetTarget().GetAPIMutex());
+ return m_opaque_sp->GetConditionText ();
+ }
+ return NULL;
+}
+
+void
+SBWatchpoint::SetCondition (const char *condition)
+{
+ if (m_opaque_sp)
+ {
+ Mutex::Locker api_locker (m_opaque_sp->GetTarget().GetAPIMutex());
+ m_opaque_sp->SetCondition (condition);
+ }
+}
+
bool
SBWatchpoint::GetDescription (SBStream &description, DescriptionLevel level)
{