-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDebugDispatcher.h
More file actions
47 lines (40 loc) · 1.34 KB
/
Copy pathDebugDispatcher.h
File metadata and controls
47 lines (40 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef __DEBUG_DISPATCHER_H__
#define __DEBUG_DISPATCHER_H__
#include "EvalDispatcher.h"
#include <set>
#include "TreeTags.h"
#include "DebuggerInputInterface.h"
#include "Interpreter.h"
class DebugDispatcher : public EvalDispatcher {
public:
enum ExecutionModes{
NORMAL = 0, PAUSED, STEP_OVER, STEP_IN
};
private:
std::set<std::string> pausableNodeTypes;
std::set<unsigned> breakpoints;
ExecutionModes mode;
DebuggerInputInterface *inputController;
bool skipCalls, newInlines;
std::vector<std::pair<unsigned, const Object*>> stackTrace;
unsigned currLine;
Interpreter *i;
public:
DebugDispatcher(DebuggerInputInterface *_inputController);
virtual const Value eval (Object& node) override;
void addBreakpoint(unsigned lineNo);
void removeBreakpoint(unsigned lineNo);
void removeAllBreakpoints();
void setExecutionMode(ExecutionModes m);
unsigned getCurrLine();
void setInterpreter(Interpreter *_i);
const Value* getVarByName(std::string id);
const Value* getGlobalVarByName(std::string id);
const Value* getLocalVarByName(std::string id);
const Object* getTopEnvinroment();
const Object* getGlobalEnvinroment();
const std::vector<std::pair<unsigned, const Object*>> &getStackTrace();
bool hasNewInlines();
void allInlinesProcessed();
};
#endif