Make sure the "synchronous breakpoint callbacks" get called before the thread plan logic gets invoked, and if they
ask to continue that should short-circuit the thread plans for that thread. Also add a bit more explanation for
how this machinery is supposed to work.
Also pass eExecutionPolicyOnlyWhenNeeded, not eExecutionPolicyAlways when evaluating the expression for breakpoint
conditions.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@155236 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Target/Thread.cpp b/source/Target/Thread.cpp
index c483e5a..7445ffc 100644
--- a/source/Target/Thread.cpp
+++ b/source/Target/Thread.cpp
@@ -333,6 +333,17 @@
// The top most plan always gets to do the trace log...
current_plan->DoTraceLog ();
+
+ // First query the stop info's ShouldStopSynchronous. This handles "synchronous" stop reasons, for example the breakpoint
+ // command on internal breakpoints. If a synchronous stop reason says we should not stop, then we don't have to
+ // do any more work on this stop.
+ StopInfoSP private_stop_info (GetPrivateStopReason());
+ if (private_stop_info && private_stop_info->ShouldStopSynchronous(event_ptr) == false)
+ {
+ if (log)
+ log->Printf ("StopInfo::ShouldStop async callback says we should not stop, returning ShouldStop of false.");
+ return false;
+ }
// If the base plan doesn't understand why we stopped, then we have to find a plan that does.
// If that plan is still working, then we don't need to do any more work. If the plan that explains