-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMICommand.h
201 lines (179 loc) · 6.83 KB
/
MICommand.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
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
/******************************************************************************
* Copyright (c) 2005 The Regents of the University of California.
* This material was produced under U.S. Government contract W-7405-ENG-36
* for Los Alamos National Laboratory, which is operated by the University
* of California for the U.S. Department of Energy. The U.S. Government has
* rights to use, reproduce, and distribute this software. NEITHER THE
* GOVERNMENT NOR THE UNIVERSITY MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR
* ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified
* to produce derivative works, such modified software should be clearly
* marked, so as not to confuse it with the version available from LANL.
*
* Additionally, this program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* LA-CC 04-115
*
* Copyright 2010-2014 Cray Inc. All Rights Reserved.
*
******************************************************************************/
#ifndef _MICOMMAND_H_
#define _MICOMMAND_H_
#include "MIResultRecord.h"
#include "MIOutput.h"
struct MISession;
struct MICommand {
char * command; /* command to execute */
char ** options; /* command options */
int num_options; /* number of options for command */
int opt_size; /* allocated size of options */
int completed; /* command has been completed */
int expected_class;
MIOutput * output; /* result from completed command */
void (*callback)(MIResultRecord *, void *); /* command completed callback */
void * cb_data; /* callback data */
long timeout; /* timeout to wait for response (ms) */
};
typedef struct MICommand MICommand;
/*
* enum for commonly used print-values option passed to commands.
*/
enum MIPrintValues
{
NO_VALUES,
ALL_VALUES,
SIMPLE_VALUES
};
typedef enum MIPrintValues MIPrintValues;
extern MICommand * MICommandNew(char *, int);
extern void MICommandSetTimeout(MICommand *cmd, int timeout);
extern void MICommandFree(MICommand *cmd);
extern void MICommandAddOption(MICommand *cmd, char *opt, char *arg);
extern int MICommandCompleted(MICommand *cmd);
extern int MICommandResultOK(MICommand *cmd);
extern MIResultRecord * MICommandResult(MICommand *cmd);
extern int MICommandResultClass(MICommand *cmd);
extern char * MICommandResultErrorMessage(MICommand *cmd);
extern char * MICommandConsoleOOBMessages(MICommand *cmd);
extern void MICommandRegisterCallback(MICommand *cmd, void (*callback)(MIResultRecord *, void *), void *data);
extern char * MICommandToString(MICommand *cmd);
/*
* -gdb-* commands
*/
extern MICommand *MIGDBSet(char *, char *);
extern MICommand *MIGDBExit(void);
extern MICommand *MIGDBShowEndian(void);
extern MICommand *MIGDBVersion(void);
/*
* -environment-* commands
*/
extern MICommand *MIEnvironmentCd(char *pathdir);
extern MICommand *MIEnvironmentDirectory(int reset, char **pathdirs);
extern MICommand *MIEnvironmentPath(int reset, char **pathdirs);
extern MICommand *MIEnvironmentPwd(void);
/*
* -exec-* commands
*/
extern MICommand *MIExecArguments(char **);
extern MICommand *MIExecContinue(void);
extern MICommand *MIExecRun(void);
extern MICommand *MIExecStep(int);
extern MICommand *MIExecNext(int);
extern MICommand *MIExecFinish(void);
extern MICommand *MIExecInterrupt(void);
extern MICommand *MIExecUtil(char*);
extern MICommand *MIExecStepInstruction(void);
extern MICommand *MIExecContinueAll(void);
extern MICommand *MIExecInterruptAll(void);
/*
* -file-* commands
*/
extern MICommand *MIFileExecAndSymbols(char *);
extern MICommand *MIFileExecFile(char *);
extern MICommand *MIFileListExecSourceFile(void);
extern MICommand *MIFileListExecSourceFiles(void);
extern MICommand *MIFileSymbolFile(char *);
/*
* -break-* commands
*/
extern MICommand *MIBreakInsert(int isTemporary, int isHardware, char *condition, int ignoreCount, char *line, int tid);
extern MICommand *MIBreakDelete(int nbps, int *bpids);
extern MICommand *MIBreakDisable(int nbps, int *bpids);
extern MICommand *MIBreakEnable(int nbps, int *bpids);
extern MICommand *MIBreakCondition(int nbps, int *bpids, char *expr);
extern MICommand *MIBreakWatch(char *expr, int access, int read);
extern MICommand *MIBreakAfter(int nbps, int *bpids, int ignoreCount);
extern MICommand *MIBreakInfo(int bpid);
/*
* -stack-* commands
*/
extern MICommand *MIStackSelectFrame(int level);
extern MICommand *MIStackListFrames(int low, int high);
extern MICommand *MIStackListAllFrames(void);
extern MICommand *MIStackListLocals(MIPrintValues vals);
extern MICommand *MIStackListVariables(MIPrintValues vals);
extern MICommand *MIStackListArguments(MIPrintValues vals, int low, int high);
extern MICommand *MIStackListAllArguments(MIPrintValues vals);
extern MICommand *MIStackInfoFrame(void);
extern MICommand *MIStackInfoDepth(void);
extern MICommand *CLIFrame(void);
/*
* -var-* commands
*/
extern MICommand *MIVarCreate(char *name, char *frame, char *expr);
extern MICommand *MIVarDelete(char *name);
extern MICommand *MIVarListChildren(char *name);
extern MICommand *MIVarEvaluateExpression(char *name);
extern MICommand *MIDataEvaluateExpression(char *name);
extern MICommand *MIVarUpdate(char *name);
extern MICommand *MIVarInfoType(char *name);
extern MICommand *MIVarInfoNumChildren(char *name);
extern MICommand *MIVarInfoPathExpression(char *name);
/*
* -thread-* commands
*/
extern MICommand *CLIInfoThreads(void);
extern MICommand *MIThreadSelect(int threadNum);
/*
* -target-* commands
*/
extern MICommand *MITargetAttach(int pgid);
extern MICommand *MITargetDetach(int pgid);
extern MICommand *MITargetDetachAll(void);
/*
* -data-* commands
*/
extern MICommand *MIDataReadMemory(long, char *, char *, int, int, int, char *);
extern MICommand *MIDataWriteMemory(long offset, char * address, char * format, int wordSize, char * value);
extern MICommand *MIDataWriteMemoryBytes(char *address, char *contents);
extern MICommand *MIDataReadDisassemble(char* startAddr, char* endAddr, char* format);
#ifdef __APPLE__
extern MICommand *MIPidInfo(void);
#endif /* __APPLE__ */
/*
* Non-MI CLI commands
*/
extern MICommand *CLIPtype(char *name);
extern MICommand *CLIWhatis(char *var);
extern MICommand *CLIInfoProc(void);
extern MICommand *CLIBypass(int cmd_argc, char *cmd_argv[]);
extern MICommand *CLIInfoScope(char *location);
/*
* CLI signal commands
*/
extern MICommand *CLIListSignals(char *);
extern MICommand *CLISignalInfo(char *);
extern MICommand *CLIHandle(char *);
/*
* CLI List source lines command
*/
extern MICommand *CLIList(char *);
extern MICommand *CLIListSingleLine(int);
/*
* Print command
*/
extern MICommand *CLIPrint(char *arg);
extern MICommand *CLIPrintHex(char *arg);
#endif /* _MICOMMAND_H_ */