74 auto handleUserInput = [&]() ->
bool {
75 if (!onBreakpointControlExecutionCallback)
77 auto todoNext = onBreakpointControlExecutionCallback(
actionStack);
80 depthToBreak = std::nullopt;
83 depthToBreak = std::nullopt;
86 depthToBreak = depth + 1;
92 depthToBreak = depth - 1;
95 depthToBreak = std::nullopt;
96 rerunControlStack.push_back(depth);
99 llvm::report_fatal_error(
"Unknown control request");
102 auto rerunCurrentActionIfRequested = [&]() ->
bool {
103 if (!rerunControlStack.empty() && rerunControlStack.back() == depth) {
105 rerunControlStack.pop_back();
115 for (
auto *breakpointManager : breakpoints) {
116 breakpoint = breakpointManager->match(action);
122 bool shouldExecuteAction =
true;
125 if (breakpoint || (depthToBreak && depth <= depthToBreak))
126 shouldExecuteAction = handleUserInput();
129 for (
auto *observer : observers)
130 observer->beforeExecute(
actionStack, breakpoint, shouldExecuteAction);
132 if (shouldExecuteAction) {
137 for (
auto *observer : observers)
141 if (rerunCurrentActionIfRequested())
144 if (depthToBreak && depth <= depthToBreak) {
146 rerunCurrentActionIfRequested();
static const LLVM_THREAD_LOCAL ActionActiveStack * actionStack
void registerObserver(Observer *observer)
Register a new Observer on this context.
void operator()(function_ref< void()> transform, const Action &action)
Process the given action.
This abstract class defines the interface used to observe an Action execution.