- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCommand.h
More file actions
Latest commit
136 lines (109 loc) · 2.66 KB
/
Copy pathCommand.h
File metadata and controls
136 lines (109 loc) · 2.66 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
/*
Copyright (C) 2011 RVRS Industriis <http://rvrs.in>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef COMMAND_20110828_H_
#defineCOMMAND_20110828_H_
#include<QString>
#include<QStringList>
#include<QList>
#include<QMap>
#include"Debugger.h"
classCommand
{
public:
Command(const QString& command, const QStringList& arguments);
boolisValid() const { return valid_; }
boolexecute();
QString error() const { return error_; }
QString name() const { return command_; }
QString description() const { return descriptions[command_]; }
QStringList arghelp() const { return help[command_]; }
static QStringList commands() { return functions.keys(); }
private:
voidinitFunctions();
voidinitDescriptions();
voidinitHelp();
boolargCheck(int min, int max);
DebuggerCoreInterface* getDebuggerCoreChecked(bool checkRunning = true);
/*
* TODO:
*
* BP+ (BPX?) instead of BP
* BP- (BPR?)(* for all)
* BPD disable
* BP(toggle)
* HWBP ...
*
* RUN [address]
* STEP(STEPI) [times]
* STEPO [times]
* BREAK
*
* KILL
* DETACH
* ATTACH pid
* OPEN path
* RESTART (target)
*
* QUIT (edb)
*
* G (go to)
*
* REG register [, value]
* PUSH val
* POP
*
* PROT address [, protection : rwx/---]
*
* DUMP address, file
* LOAD address, file
* COPY dest, src, size
* FILL dest, data, size
* FIND mem, data [, size]
* //ALLOC
**/
boolcmd_AN();
boolcmd_BP();
boolcmd_GOTO();
boolcmd_PAUSE();
boolcmd_RUN();
boolcmd_STEP();
boolcmd_STEPO();
boolcmd_REG();
boolcmd_PUSH();
boolcmd_POP();
boolcmd_PROT();
boolcmd_FIND();
boolcmd_COPY();
boolcmd_FILL();
boolcmd_DUMP();
boolcmd_LOAD();
boolcmd_KILL();
boolcmd_DETACH();
boolcmd_ATTACH();
boolcmd_OPEN();
boolcmd_RESTART();
boolcmd_QUIT();
private:
typedefbool (Command::*fCommand)();
// make sure static maps are initialized
staticconst Command dummy;
static QMap<QString, fCommand> functions;
static QMap<QString, QString> descriptions;
static QMap<QString, QStringList> help;
QString command_;
QStringList arguments_;
bool valid_;
QString error_;
};
#endif