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.
llvm-svn: 142227
diff --git a/lldb/source/API/SBWatchpoint.cpp b/lldb/source/API/SBWatchpoint.cpp
index de43364..ec2dc12 100644
--- a/lldb/source/API/SBWatchpoint.cpp
+++ b/lldb/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)
{