-
Notifications
You must be signed in to change notification settings - Fork 1
/
gdb.h
82 lines (71 loc) · 2.06 KB
/
gdb.h
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#ifndef GDB_H
#define GDB_H
#include <QProcess>
#include <QFile>
#include <QStringList>
#include <vector>
#include <queue>
#include <list>
#include "breakpoint.h"
#include "variable.h"
class Gdb : public QProcess
{
Q_OBJECT
public:
Gdb();
Gdb(QString gdbPath);
void start(const QStringList &arguments = QStringList() << "--interpreter=mi",
QProcess::OpenMode mode = QIODevice::ReadWrite);
void write(QByteArray &command);
void readStdOutput();
void readErrOutput();
const QString& getOutput()const;
void openProject(const QString& fileName);
void run();
void stepOver();
void setBreakPoint(unsigned int line);
void clearBreakPoint(unsigned int line);
void stepIn();
void stepOut();
void stopExecuting();
void stepContinue();
int getCurrentLine();
void updateBreakpointsList();
std::vector<Breakpoint> getBreakpoints()const;
std::vector<Variable> getLocalVariables()const;
void getVarContent(const QString& var);
QString getVarType(Variable var);
void globalUpdate();
void setGdbPath(const QString& path);
void readType(const QString& varName);
void readContent(const QString& context);
void updateVariable64x();
void updateVariableFromBuffer();
QString getVarContentFromContext(const QString& context);
public slots:
void slotReadStdOutput();
void slotReadErrOutput();
signals:
void signalBreakpointHit(int line);
void signalLocalVarRecieved(const QString&);
void signalErrorOccured(const QString&);
void signalUpdatedVariables();
void signalTypeUpdated(Variable var);
void signalContentUpdated(Variable var);
void signalReadyReadGdb();
private:
QFile mGdbFile;
QString mErrorMessage;
QString mBuffer;
std::vector<Breakpoint> mBreakpointsList;
std::vector<Variable> mVariablesList;
QString temp;
bool mInfoCaptured;
bool mWhatisCaptured;
QString mWhatisBuffer;
QString mPrintBuffer;
bool collect;
std::list<Variable> mVariableTypeQueue;
bool mPrintCaptured;
};
#endif // GDB_H