]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/tools/lldb-mi/MICmdCmdData.h
MFV r277782:
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / tools / lldb-mi / MICmdCmdData.h
1 //===-- MICmdCmdData.h ------------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 //++
11 // File:                MICmdCmdData.h
12 //
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.
22 //
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:
26 //                                      MICmdCommands.cpp
27 //                                      MICmdBase.h / .cpp
28 //                                      MICmdCmd.h / .cpp
29 //                              For an introduction to adding a new command see CMICmdCmdSupportInfoMiCmdQuery
30 //                              command class as an example.
31 //
32 // Environment: Compilers:      Visual C++ 12.
33 //                                                      gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
34 //                              Libraries:      See MIReadmetxt. 
35 //
36 // Copyright:   None.
37 //--
38
39 #pragma once
40
41 // In-house headers:
42 #include "MICmdBase.h"
43 #include "MICmnMIValueTuple.h"
44 #include "MICmnMIValueList.h"
45
46 //++ ============================================================================
47 // Details:     MI command class. MI commands derived from the command base class.
48 //                      *this class implements MI command "data-evaluate-expression".
49 // Gotchas:     None.
50 // Authors:     Illya Rudkin 26/03/2014.
51 // Changes:     None.
52 //--
53 class CMICmdCmdDataEvaluateExpression : public CMICmdBase
54 {
55 // Statics:
56 public:
57         // Required by the CMICmdFactory when registering *this command
58         static CMICmdBase *     CreateSelf( void );
59
60 // Methods:
61 public:
62         /* ctor */      CMICmdCmdDataEvaluateExpression( void );
63
64 // Overridden:
65 public:
66         // From CMICmdInvoker::ICmd
67         virtual bool    Execute( void );
68         virtual bool    Acknowledge( void );
69         virtual bool    ParseArgs( void );
70         // From CMICmnBase
71         /* dtor */ virtual ~CMICmdCmdDataEvaluateExpression( void );
72
73 // Methods:
74 private:
75         bool    HaveInvalidCharacterInExpression( const CMIUtilString & vrExpr, MIchar & vrwInvalidChar );
76
77 // Attributes:
78 private:
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;              
89 };
90
91 //++ ============================================================================
92 // Details:     MI command class. MI commands derived from the command base class.
93 //                      *this class implements MI command "data-disassemble".
94 // Gotchas:     None.
95 // Authors:     Illya Rudkin 19/05/2014.
96 // Changes:     None.
97 //--
98 class CMICmdCmdDataDisassemble : public CMICmdBase
99 {
100 // Statics:
101 public:
102         // Required by the CMICmdFactory when registering *this command
103         static CMICmdBase *     CreateSelf( void );
104
105 // Methods:
106 public:
107         /* ctor */      CMICmdCmdDataDisassemble( void );
108
109 // Overridden:
110 public:
111         // From CMICmdInvoker::ICmd
112         virtual bool    Execute( void );
113         virtual bool    Acknowledge( void );
114         virtual bool    ParseArgs( void );
115         // From CMICmnBase
116         /* dtor */ virtual ~CMICmdCmdDataDisassemble( void );
117
118 // Attributes:
119 private:
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;
126 };
127
128 //++ ============================================================================
129 // Details:     MI command class. MI commands derived from the command base class.
130 //                      *this class implements MI command "data-read-memory-bytes".
131 // Gotchas:     None.
132 // Authors:     Illya Rudkin 20/05/2014.
133 // Changes:     None.
134 //--
135 class CMICmdCmdDataReadMemoryBytes : public CMICmdBase
136 {
137 // Statics:
138 public:
139         // Required by the CMICmdFactory when registering *this command
140         static CMICmdBase *     CreateSelf( void );
141
142 // Methods:
143 public:
144         /* ctor */      CMICmdCmdDataReadMemoryBytes( void );
145
146 // Overridden:
147 public:
148         // From CMICmdInvoker::ICmd
149         virtual bool    Execute( void );
150         virtual bool    Acknowledge( void );
151         virtual bool    ParseArgs( void );
152         // From CMICmnBase
153         /* dtor */ virtual ~CMICmdCmdDataReadMemoryBytes( void );
154
155 // Attributes:
156 private:
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;
165 };
166
167 //++ ============================================================================
168 // Details:     MI command class. MI commands derived from the command base class.
169 //                      *this class implements MI command "data-read-memory".
170 // Gotchas:     None.
171 // Authors:     Illya Rudkin 21/05/2014.
172 // Changes:     None.
173 //--
174 class CMICmdCmdDataReadMemory : public CMICmdBase
175 {
176 // Statics:
177 public:
178         // Required by the CMICmdFactory when registering *this command
179         static CMICmdBase *     CreateSelf( void );
180
181 // Methods:
182 public:
183         /* ctor */      CMICmdCmdDataReadMemory( void );
184
185 // Overridden:
186 public:
187         // From CMICmdInvoker::ICmd
188         virtual bool    Execute( void );
189         virtual bool    Acknowledge( void );
190         // From CMICmnBase
191         /* dtor */ virtual ~CMICmdCmdDataReadMemory( void );
192 };
193
194 //++ ============================================================================
195 // Details:     MI command class. MI commands derived from the command base class.
196 //                      *this class implements MI command "data-list-register-names".
197 // Gotchas:     None.
198 // Authors:     Illya Rudkin 21/05/2014.
199 // Changes:     None.
200 //--
201 class CMICmdCmdDataListRegisterNames : public CMICmdBase
202 {
203 // Statics:
204 public:
205         // Required by the CMICmdFactory when registering *this command
206         static CMICmdBase *     CreateSelf( void );
207
208 // Methods:
209 public:
210         /* ctor */      CMICmdCmdDataListRegisterNames( void );
211
212 // Overridden:
213 public:
214         // From CMICmdInvoker::ICmd
215         virtual bool    Execute( void );
216         virtual bool    Acknowledge( void );
217         virtual bool    ParseArgs( void );
218         // From CMICmnBase
219         /* dtor */ virtual ~CMICmdCmdDataListRegisterNames( void );
220
221 // Attributes:
222 private:
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;
226 };
227
228 //++ ============================================================================
229 // Details:     MI command class. MI commands derived from the command base class.
230 //                      *this class implements MI command "data-list-register-values".
231 // Gotchas:     None.
232 // Authors:     Illya Rudkin 21/05/2014.
233 // Changes:     None.
234 //--
235 class CMICmdCmdDataListRegisterValues : public CMICmdBase
236 {
237 // Statics:
238 public:
239         // Required by the CMICmdFactory when registering *this command
240         static CMICmdBase *     CreateSelf( void );
241
242 // Methods:
243 public:
244         /* ctor */      CMICmdCmdDataListRegisterValues( void );
245
246 // Overridden:
247 public:
248         // From CMICmdInvoker::ICmd
249         virtual bool    Execute( void );
250         virtual bool    Acknowledge( void );
251         virtual bool    ParseArgs( void );
252         // From CMICmnBase
253         /* dtor */ virtual ~CMICmdCmdDataListRegisterValues( void );
254
255 // Methods:
256 private:
257         lldb::SBValue   GetRegister( const MIuint vRegisterIndex ) const;
258
259 // Attributes:
260 private:
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;
267 };
268
269 //++ ============================================================================
270 // Details:     MI command class. MI commands derived from the command base class.
271 //                      *this class implements MI command "data-list-changed-registers".
272 // Gotchas:     None.
273 // Authors:     Illya Rudkin 22/05/2014.
274 // Changes:     None.
275 //--
276 class CMICmdCmdDataListRegisterChanged : public CMICmdBase
277 {
278 // Statics:
279 public:
280         // Required by the CMICmdFactory when registering *this command
281         static CMICmdBase *     CreateSelf( void );
282
283 // Methods:
284 public:
285         /* ctor */      CMICmdCmdDataListRegisterChanged( void );
286
287 // Overridden:
288 public:
289         // From CMICmdInvoker::ICmd
290         virtual bool    Execute( void );
291         virtual bool    Acknowledge( void );
292         // From CMICmnBase
293         /* dtor */ virtual ~CMICmdCmdDataListRegisterChanged( void );
294 };
295
296 //++ ============================================================================
297 // Details:     MI command class. MI commands derived from the command base class.
298 //                      *this class implements MI command "data-read-memory-bytes".
299 // Gotchas:     None.
300 // Authors:     Illya Rudkin 30/05/2014.
301 // Changes:     None.
302 //--
303 class CMICmdCmdDataWriteMemoryBytes : public CMICmdBase
304 {
305 // Statics:
306 public:
307         // Required by the CMICmdFactory when registering *this command
308         static CMICmdBase *     CreateSelf( void );
309
310 // Methods:
311 public:
312         /* ctor */      CMICmdCmdDataWriteMemoryBytes( void );
313
314 // Overridden:
315 public:
316         // From CMICmdInvoker::ICmd
317         virtual bool    Execute( void );
318         virtual bool    Acknowledge( void );
319         virtual bool    ParseArgs( void );
320         // From CMICmnBase
321         /* dtor */ virtual ~CMICmdCmdDataWriteMemoryBytes( void );
322
323 // Attributes:
324 private:
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;     
329         MIuint64                        m_nAddr;
330         CMIUtilString           m_strContents;
331         MIuint64                        m_nCount;
332 };
333
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.
338 // Gotchas:     None.
339 // Authors:     Illya Rudkin 02/05/2014.
340 // Changes:     None.
341 //--
342 class CMICmdCmdDataWriteMemory : public CMICmdBase
343 {
344 // Statics:
345 public:
346         // Required by the CMICmdFactory when registering *this command
347         static CMICmdBase *     CreateSelf( void );
348
349 // Methods:
350 public:
351         /* ctor */      CMICmdCmdDataWriteMemory( void );
352
353 // Overridden:
354 public:
355         // From CMICmdInvoker::ICmd
356         virtual bool    Execute( void );
357         virtual bool    Acknowledge( void );
358         virtual bool    ParseArgs( void );
359         // From CMICmnBase
360         /* dtor */ virtual ~CMICmdCmdDataWriteMemory( void );
361
362 // Attributes:
363 private:
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.
370         MIuint64                        m_nAddr;
371         CMIUtilString           m_strContents;
372         MIuint64                        m_nCount;
373         MIuchar *                       m_pBufferMemory;                
374 };