1 //===-- MICmdCmdData.h ------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 // File: MICmdCmdData.h
13 // Overview: CMICmdCmdDataEvaluateExpression interface.
14 // CMICmdCmdDataDisassemble interface.
15 // CMICmdCmdDataReadMemoryBytes interface.
16 // CMICmdCmdDataReadMemory interface.
17 // CMICmdCmdDataListRegisterNames interface.
18 // CMICmdCmdDataListRegisterValues interface.
19 // CMICmdCmdDataListRegisterChanged interface.
20 // CMICmdCmdDataWriteMemoryBytes interface.
21 // CMICmdCmdDataWriteMemory interface.
23 // To implement new MI commands derive a new command class from the command base
24 // class. To enable the new command for interpretation add the new command class
25 // to the command factory. The files of relevance are:
29 // For an introduction to adding a new command see CMICmdCmdSupportInfoMiCmdQuery
30 // command class as an example.
32 // Environment: Compilers: Visual C++ 12.
33 // gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
34 // Libraries: See MIReadmetxt.
42 #include "MICmdBase.h"
43 #include "MICmnMIValueTuple.h"
44 #include "MICmnMIValueList.h"
46 //++ ============================================================================
47 // Details: MI command class. MI commands derived from the command base class.
48 // *this class implements MI command "data-evaluate-expression".
50 // Authors: Illya Rudkin 26/03/2014.
53 class CMICmdCmdDataEvaluateExpression : public CMICmdBase
57 // Required by the CMICmdFactory when registering *this command
58 static CMICmdBase * CreateSelf( void );
62 /* ctor */ CMICmdCmdDataEvaluateExpression( void );
66 // From CMICmdInvoker::ICmd
67 virtual bool Execute( void );
68 virtual bool Acknowledge( void );
69 virtual bool ParseArgs( void );
71 /* dtor */ virtual ~CMICmdCmdDataEvaluateExpression( void );
75 bool HaveInvalidCharacterInExpression( const CMIUtilString & vrExpr, MIchar & vrwInvalidChar );
79 bool m_bExpressionValid; // True = yes is valid, false = not valid
80 bool m_bEvaluatedExpression; // True = yes is expression evaluated, false = failed
81 CMIUtilString m_strValue;
82 CMICmnMIValueTuple m_miValueTuple;
83 bool m_bCompositeVarType; // True = yes composite type, false = internal type
84 bool m_bFoundInvalidChar; // True = yes found unexpected character in the expression, false = all ok
85 MIchar m_cExpressionInvalidChar;
86 const CMIUtilString m_constStrArgThread; // Not specified in MI spec but Eclipse gives this option. Not handled by command.
87 const CMIUtilString m_constStrArgFrame; // Not specified in MI spec but Eclipse gives this option. Not handled by command.
88 const CMIUtilString m_constStrArgExpr;
91 //++ ============================================================================
92 // Details: MI command class. MI commands derived from the command base class.
93 // *this class implements MI command "data-disassemble".
95 // Authors: Illya Rudkin 19/05/2014.
98 class CMICmdCmdDataDisassemble : public CMICmdBase
102 // Required by the CMICmdFactory when registering *this command
103 static CMICmdBase * CreateSelf( void );
107 /* ctor */ CMICmdCmdDataDisassemble( void );
111 // From CMICmdInvoker::ICmd
112 virtual bool Execute( void );
113 virtual bool Acknowledge( void );
114 virtual bool ParseArgs( void );
116 /* dtor */ virtual ~CMICmdCmdDataDisassemble( void );
120 const CMIUtilString m_constStrArgThread; // Not specified in MI spec but Eclipse gives this option. Not handled by command.
121 const CMIUtilString m_constStrArgAddrStart; // MI spec non mandatory, *this command mandatory
122 const CMIUtilString m_constStrArgAddrEnd; // MI spec non mandatory, *this command mandatory
123 const CMIUtilString m_constStrArgConsume;
124 const CMIUtilString m_constStrArgMode;
125 CMICmnMIValueList m_miValueList;
128 //++ ============================================================================
129 // Details: MI command class. MI commands derived from the command base class.
130 // *this class implements MI command "data-read-memory-bytes".
132 // Authors: Illya Rudkin 20/05/2014.
135 class CMICmdCmdDataReadMemoryBytes : public CMICmdBase
139 // Required by the CMICmdFactory when registering *this command
140 static CMICmdBase * CreateSelf( void );
144 /* ctor */ CMICmdCmdDataReadMemoryBytes( void );
148 // From CMICmdInvoker::ICmd
149 virtual bool Execute( void );
150 virtual bool Acknowledge( void );
151 virtual bool ParseArgs( void );
153 /* dtor */ virtual ~CMICmdCmdDataReadMemoryBytes( void );
157 const CMIUtilString m_constStrArgThread; // Not specified in MI spec but Eclipse gives this option. Not handled by command.
158 const CMIUtilString m_constStrArgByteOffset;
159 const CMIUtilString m_constStrArgAddrStart;
160 const CMIUtilString m_constStrArgNumBytes;
161 MIuchar * m_pBufferMemory;
162 MIuint64 m_nAddrStart;
163 MIuint64 m_nAddrNumBytesToRead;
164 MIuint64 m_nAddrOffset;
167 //++ ============================================================================
168 // Details: MI command class. MI commands derived from the command base class.
169 // *this class implements MI command "data-read-memory".
171 // Authors: Illya Rudkin 21/05/2014.
174 class CMICmdCmdDataReadMemory : public CMICmdBase
178 // Required by the CMICmdFactory when registering *this command
179 static CMICmdBase * CreateSelf( void );
183 /* ctor */ CMICmdCmdDataReadMemory( void );
187 // From CMICmdInvoker::ICmd
188 virtual bool Execute( void );
189 virtual bool Acknowledge( void );
191 /* dtor */ virtual ~CMICmdCmdDataReadMemory( void );
194 //++ ============================================================================
195 // Details: MI command class. MI commands derived from the command base class.
196 // *this class implements MI command "data-list-register-names".
198 // Authors: Illya Rudkin 21/05/2014.
201 class CMICmdCmdDataListRegisterNames : public CMICmdBase
205 // Required by the CMICmdFactory when registering *this command
206 static CMICmdBase * CreateSelf( void );
210 /* ctor */ CMICmdCmdDataListRegisterNames( void );
214 // From CMICmdInvoker::ICmd
215 virtual bool Execute( void );
216 virtual bool Acknowledge( void );
217 virtual bool ParseArgs( void );
219 /* dtor */ virtual ~CMICmdCmdDataListRegisterNames( void );
223 const CMIUtilString m_constStrArgThreadGroup; // Not specified in MI spec but Eclipse gives this option
224 const CMIUtilString m_constStrArgRegNo; // Not handled by *this command
225 CMICmnMIValueList m_miValueList;
228 //++ ============================================================================
229 // Details: MI command class. MI commands derived from the command base class.
230 // *this class implements MI command "data-list-register-values".
232 // Authors: Illya Rudkin 21/05/2014.
235 class CMICmdCmdDataListRegisterValues : public CMICmdBase
239 // Required by the CMICmdFactory when registering *this command
240 static CMICmdBase * CreateSelf( void );
244 /* ctor */ CMICmdCmdDataListRegisterValues( void );
248 // From CMICmdInvoker::ICmd
249 virtual bool Execute( void );
250 virtual bool Acknowledge( void );
251 virtual bool ParseArgs( void );
253 /* dtor */ virtual ~CMICmdCmdDataListRegisterValues( void );
257 lldb::SBValue GetRegister( const MIuint vRegisterIndex ) const;
261 const CMIUtilString m_constStrArgThread; // Not specified in MI spec but Eclipse gives this option
262 const CMIUtilString m_constStrArgSkip; // Not handled by *this command
263 const CMIUtilString m_constStrArgFormat;
264 const CMIUtilString m_constStrArgRegNo;
265 CMICmnMIValueList m_miValueList;
266 lldb::SBProcess * m_pProcess;
269 //++ ============================================================================
270 // Details: MI command class. MI commands derived from the command base class.
271 // *this class implements MI command "data-list-changed-registers".
273 // Authors: Illya Rudkin 22/05/2014.
276 class CMICmdCmdDataListRegisterChanged : public CMICmdBase
280 // Required by the CMICmdFactory when registering *this command
281 static CMICmdBase * CreateSelf( void );
285 /* ctor */ CMICmdCmdDataListRegisterChanged( void );
289 // From CMICmdInvoker::ICmd
290 virtual bool Execute( void );
291 virtual bool Acknowledge( void );
293 /* dtor */ virtual ~CMICmdCmdDataListRegisterChanged( void );
296 //++ ============================================================================
297 // Details: MI command class. MI commands derived from the command base class.
298 // *this class implements MI command "data-read-memory-bytes".
300 // Authors: Illya Rudkin 30/05/2014.
303 class CMICmdCmdDataWriteMemoryBytes : public CMICmdBase
307 // Required by the CMICmdFactory when registering *this command
308 static CMICmdBase * CreateSelf( void );
312 /* ctor */ CMICmdCmdDataWriteMemoryBytes( void );
316 // From CMICmdInvoker::ICmd
317 virtual bool Execute( void );
318 virtual bool Acknowledge( void );
319 virtual bool ParseArgs( void );
321 /* dtor */ virtual ~CMICmdCmdDataWriteMemoryBytes( void );
325 const CMIUtilString m_constStrArgThread; // Not specified in MI spec but Eclipse gives this option. Not handled by command.
326 const CMIUtilString m_constStrArgAddr;
327 const CMIUtilString m_constStrArgContents;
328 const CMIUtilString m_constStrArgCount;
330 CMIUtilString m_strContents;
334 //++ ============================================================================
335 // Details: MI command class. MI commands derived from the command base class.
336 // *this class implements MI command "data-read-memory".
337 // Not specified in MI spec but Eclipse gives *this command.
339 // Authors: Illya Rudkin 02/05/2014.
342 class CMICmdCmdDataWriteMemory : public CMICmdBase
346 // Required by the CMICmdFactory when registering *this command
347 static CMICmdBase * CreateSelf( void );
351 /* ctor */ CMICmdCmdDataWriteMemory( void );
355 // From CMICmdInvoker::ICmd
356 virtual bool Execute( void );
357 virtual bool Acknowledge( void );
358 virtual bool ParseArgs( void );
360 /* dtor */ virtual ~CMICmdCmdDataWriteMemory( void );
364 const CMIUtilString m_constStrArgThread; // Not specified in MI spec but Eclipse gives this option. Not handled by command.
365 const CMIUtilString m_constStrArgOffset; // Not specified in MI spec but Eclipse gives this option.
366 const CMIUtilString m_constStrArgAddr; // Not specified in MI spec but Eclipse gives this option.
367 const CMIUtilString m_constStrArgD; // Not specified in MI spec but Eclipse gives this option.
368 const CMIUtilString m_constStrArgNumber; // Not specified in MI spec but Eclipse gives this option.
369 const CMIUtilString m_constStrArgContents; // Not specified in MI spec but Eclipse gives this option.
371 CMIUtilString m_strContents;
373 MIuchar * m_pBufferMemory;