1
#include "DebugLogistics.h"
3
#include "simodo/ast/Node.h"
4
#include "simodo/interpret/Interpret_interface.h"
8
interpret::Direction DebugLogistics::checkDirection(const interpret::Interpret_interface & interpret)
10
if(_next_step_behavior == interpret::NextStepBehaviour::Run)
11
return interpret::Direction::Next;
13
const ast::Node * p_node = interpret.lookupOperationNode();
16
std::unique_lock<std::mutex> locker(_debug_mutex);
18
if (p_node->token().location().uri_index() == _last_uri_index
19
&& p_node->token().location().range().start().line() == _last_line)
20
return interpret::Direction::Next;
22
_last_uri_index = p_node->token().location().uri_index();
23
_last_line = p_node->token().location().range().start().line();
25
return _function_nesting <= _expected_function_nest
26
? interpret::Direction::Pause
27
: interpret::Direction::Next;
30
return interpret::Direction::Next;
33
void DebugLogistics::setNextStepBehaviour(interpret::NextStepBehaviour behavior)
35
std::unique_lock<std::mutex> locker(_debug_mutex);
37
_next_step_behavior = behavior;
41
case interpret::NextStepBehaviour::In:
42
_expected_function_nest = _function_nesting + 1;
44
case interpret::NextStepBehaviour::Out:
45
_expected_function_nest = _function_nesting - 1;
47
case interpret::NextStepBehaviour::Step:
48
_expected_function_nest = _function_nesting;
55
void DebugLogistics::onEnterFunction()
60
void DebugLogistics::onExitFunction()
65
engine::Breakpoint DebugLogistics::add(const engine::Breakpoint & breakpoint)
70
bool DebugLogistics::remove(const engine::Breakpoint & /*breakpoint*/)
75
void DebugLogistics::clear()
80
std::vector<engine::Breakpoint> DebugLogistics::breakpoints() const