-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmips32_dbg.h
More file actions
60 lines (51 loc) · 1.32 KB
/
mips32_dbg.h
File metadata and controls
60 lines (51 loc) · 1.32 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
48
49
50
51
52
53
54
55
56
57
58
59
/*
* File: mips32_dbg.h
* Author: ideras
*
* Created on September 12, 2016, 4:52 PM
*/
#ifndef MIPS32_DBG_H
#define MIPS32_DBG_H
#include <stdint.h>
#include <fstream>
#include <list>
#include <vector>
#include <map>
#include <set>
#include "adbg.h"
using namespace std;
class MemPool;
class MInstruction;
class MIPS32Sim;
class MIPS32Debugger: public AsmDebugger
{
public:
MIPS32Debugger(MIPS32Sim *sim, vector<MInstruction *> instList, MemPool *mPool) {
this->sim = sim;
this->instList = instList;
this->mPool = mPool;
inBreakpoint = false;
finished = false;
}
void showStatus();
void addBreakpoint(int line) { breakpoints.insert(line); }
void removeBreakpoint(int line) { breakpoints.erase(line); }
void removeAllBreakpoints() { breakpoints.clear(); }
bool isInBreakpoint() { return inBreakpoint; }
bool isFinished() { return finished; }
void setSourceLines(vector<string> sourceLines) { this->sourceLines = sourceLines; }
void start();
bool next();
bool run();
void stop();
bool doSimCommand(string cmd);
private:
bool inBreakpoint;
bool finished;
vector<string> sourceLines;
vector<MInstruction *> instList;
set<int> breakpoints;
MIPS32Sim *sim;
MemPool *mPool;
};
#endif /* MIPS32_DBG_H */