Cope with the case where the user-supplied callbacks want the watchpoint itself to be disabled!
Previously we put a WatchpointSentry object within StopInfo.cpp to disable-and-then-enable the watchpoint itself
while we are performing the actions associated with the triggered watchpoint, which can cause the user-initiated
watchpoint disabling action to be negated.
Add a test case to verify that a watchpoint can be disabled during the callbacks.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@162483 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Target/StopInfo.cpp b/source/Target/StopInfo.cpp
index 400829f..01d8ba9 100644
--- a/source/Target/StopInfo.cpp
+++ b/source/Target/StopInfo.cpp
@@ -463,7 +463,8 @@
{
if (process && watchpoint)
{
- process->EnableWatchpoint(watchpoint);
+ if (!watchpoint->IsDisabledDuringEphemeralMode())
+ process->EnableWatchpoint(watchpoint);
watchpoint->TurnOffEphemeralMode();
}
}