summaryrefslogtreecommitdiffstats
path: root/lldb/source/API/SBWatchpoint.cpp
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-10-17 18:58:00 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-10-17 18:58:00 +0000
commit16dcf718d31e9d2aff445baa13658c0810108310 (patch)
tree73305ec234f6b5fa7cbef74eac17b2d0ff518d30 /lldb/source/API/SBWatchpoint.cpp
parenta7e0b908975041359f82a333b69db61e731608ce (diff)
downloadbcm5719-llvm-16dcf718d31e9d2aff445baa13658c0810108310.tar.gz
bcm5719-llvm-16dcf718d31e9d2aff445baa13658c0810108310.zip
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
Diffstat (limited to 'lldb/source/API/SBWatchpoint.cpp')
-rw-r--r--lldb/source/API/SBWatchpoint.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/lldb/source/API/SBWatchpoint.cpp b/lldb/source/API/SBWatchpoint.cpp
index de43364f049..ec2dc128f15 100644
--- a/lldb/source/API/SBWatchpoint.cpp
+++ b/lldb/source/API/SBWatchpoint.cpp
@@ -205,6 +205,27 @@ SBWatchpoint::SetIgnoreCount (uint32_t n)
}
}
+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)
{
OpenPOWER on IntegriCloud