summaryrefslogtreecommitdiff
path: root/lldb/source/Breakpoint/Watchpoint.cpp
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2012-08-21 23:17:04 +0000
committerJohnny Chen <johnny.chen@apple.com>2012-08-21 23:17:04 +0000
commit4fe2302ae218217e52563d3f78183283960cd4bb (patch)
tree9b5d581f5104a9633165d105eb4fbf755af1f01c /lldb/source/Breakpoint/Watchpoint.cpp
parentbbdd46789554fc9ab4e348f69ee5b95d1347bd58 (diff)
Fix test failures in TestWatchpointIter.py due to http://llvm.org/viewvc/llvm-project?rev=162322&view=rev.
llvm-svn: 162328
Diffstat (limited to 'lldb/source/Breakpoint/Watchpoint.cpp')
-rw-r--r--lldb/source/Breakpoint/Watchpoint.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/lldb/source/Breakpoint/Watchpoint.cpp b/lldb/source/Breakpoint/Watchpoint.cpp
index 7c048fadf4a7..3736adb3b730 100644
--- a/lldb/source/Breakpoint/Watchpoint.cpp
+++ b/lldb/source/Breakpoint/Watchpoint.cpp
@@ -29,6 +29,7 @@ Watchpoint::Watchpoint (lldb::addr_t addr, size_t size, bool hardware) :
m_enabled(false),
m_is_hardware(hardware),
m_is_watch_variable(false),
+ m_is_ephemeral(false),
m_watch_read(0),
m_watch_write(0),
m_watch_was_read(0),
@@ -307,12 +308,29 @@ Watchpoint::IsEnabled() const
return m_enabled;
}
+// Within StopInfo.cpp, we purposely turn on the ephemeral mode right before temporarily disable the watchpoint
+// in order to perform possible watchpoint actions without triggering further watchpoint events.
+// After the temporary disabled watchpoint is enabled, we then turn off the ephemeral mode.
+
+void
+Watchpoint::TurnOnEphemeralMode()
+{
+ m_is_ephemeral = true;
+}
+
+void
+Watchpoint::TurnOffEphemeralMode()
+{
+ m_is_ephemeral = false;
+}
+
void
Watchpoint::SetEnabled(bool enabled)
{
if (!enabled)
{
- SetHardwareIndex(LLDB_INVALID_INDEX32);
+ if (!m_is_ephemeral)
+ SetHardwareIndex(LLDB_INVALID_INDEX32);
// Don't clear the snapshots for now.
// Within StopInfo.cpp, we purposely do disable/enable watchpoint while performing watchpoint actions.
//ClearSnapshots();