]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/tools/lldb-mi/MICmdCmdVar.h
Merge ^/head r275759 through r275911.
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / tools / lldb-mi / MICmdCmdVar.h
1 //===-- MICmdCmdVar.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:                MICmdCmdVar.h
12 //
13 // Overview:    CMICmdCmdVarCreate                              interface.
14 //                              CMICmdCmdVarUpdate                              interface.
15 //                              CMICmdCmdVarDelete                              interface.
16 //                              CMICmdCmdVarAssign                              interface.
17 //                              CMICmdCmdVarSetFormat                   interface.
18 //                              CMICmdCmdVarListChildren                interface.
19 //                              CMICmdCmdVarEvaluateExpression  interface.
20 //                              CMICmdCmdVarInfoPathExpression  interface.
21 //                              CMICmdCmdVarShowAttributes              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 #include "MICmnLLDBDebugSessionInfoVarObj.h"
46
47 // Declarations:
48 class CMICmnLLDBDebugSessionInfoVarObj;
49
50 //++ ============================================================================
51 // Details:     MI command class. MI commands derived from the command base class.
52 //                      *this class implements MI command "var-create".
53 // Gotchas:     None.
54 // Authors:     Illya Rudkin 24/03/2014.
55 // Changes:     None.
56 //--
57 class CMICmdCmdVarCreate : public CMICmdBase
58 {
59 // Statics:
60 public:
61         // Required by the CMICmdFactory when registering *this command
62         static CMICmdBase *     CreateSelf( void );
63
64 // Methods:
65 public:
66         /* ctor */      CMICmdCmdVarCreate( void );
67
68 // Overridden:
69 public:
70         // From CMICmdInvoker::ICmd
71         virtual bool    Execute( void );
72         virtual bool    Acknowledge( void );
73         virtual bool    ParseArgs( void );
74         // From CMICmnBase
75         /* dtor */ virtual ~CMICmdCmdVarCreate( void );
76
77 // Attribute:
78 private:
79         CMIUtilString           m_strVarName;
80         MIuint                          m_nChildren;
81         MIuint                          m_nMore;
82         MIuint64                        m_nThreadId;
83         CMIUtilString           m_strType;
84         bool                            m_bValid;                                               // True = Variable is valid, false = not valid          
85         CMIUtilString           m_strExpression;
86         CMIUtilString           m_strValue;
87         const CMIUtilString     m_constStrArgThread;                    // Not specified in MI spec but Eclipse gives this option
88         const CMIUtilString     m_constStrArgThreadGroup;               // Not specified in MI spec but Eclipse gives this option
89         const CMIUtilString     m_constStrArgFrame;                             // Not specified in MI spec but Eclipse gives this option
90         const CMIUtilString     m_constStrArgName;
91         const CMIUtilString     m_constStrArgFrameAddr;
92         const CMIUtilString     m_constStrArgExpression;        
93 };
94
95 //++ ============================================================================
96 // Details:     MI command class. MI commands derived from the command base class.
97 //                      *this class implements MI command "var-update".
98 // Gotchas:     None.
99 // Authors:     Illya Rudkin 25/03/2014.
100 // Changes:     None.
101 //--
102 class CMICmdCmdVarUpdate : public CMICmdBase
103 {
104 // Statics:
105 public:
106         // Required by the CMICmdFactory when registering *this command
107         static CMICmdBase *     CreateSelf( void );
108
109 // Methods:
110 public:
111         /* ctor */      CMICmdCmdVarUpdate( void );
112
113 // Overridden:
114 public:
115         // From CMICmdInvoker::ICmd
116         virtual bool    Execute( void );
117         virtual bool    Acknowledge( void );
118         virtual bool    ParseArgs( void );
119
120 // Overridden:
121 public:
122         // From CMICmnBase
123         /* dtor */ virtual ~CMICmdCmdVarUpdate( void );
124
125 // Methods:
126 private:
127         bool    ExamineSBValueForChange( const CMICmnLLDBDebugSessionInfoVarObj & vrVarObj, const bool vbIgnoreVarType, bool & vrwbChanged );
128         bool    MIFormResponse( const CMIUtilString & vrStrVarName, const CMIUtilString & vrStrValue, const CMIUtilString & vrStrScope );
129
130 // Attribute:
131 private:
132         CMIUtilString           m_strValueName;
133         const CMIUtilString     m_constStrArgPrintValues;               // Not handled by *this command
134         const CMIUtilString     m_constStrArgName;
135         bool                            m_bValueChangedArrayType;               // True = yes value changed, false = no change
136         bool                            m_bValueChangedCompositeType;   // True = yes value changed, false = no change
137         bool                            m_bValueChangedNormalType;              // True = yes value changed, false = no change
138         CMICmnMIValueList       m_miValueList;
139 };
140
141 //++ ============================================================================
142 // Details:     MI command class. MI commands derived from the command base class.
143 //                      *this class implements MI command "var-delete".
144 // Gotchas:     None.
145 // Authors:     Illya Rudkin 25/03/2014.
146 // Changes:     None.
147 //--
148 class CMICmdCmdVarDelete : public CMICmdBase
149 {
150 // Statics:
151 public:
152         // Required by the CMICmdFactory when registering *this command
153         static CMICmdBase *     CreateSelf( void );
154
155 // Methods:
156 public:
157         /* ctor */      CMICmdCmdVarDelete( void );
158
159 // Overridden:
160 public:
161         // From CMICmdInvoker::ICmd
162         virtual bool    Execute( void );
163         virtual bool    Acknowledge( void );
164         virtual bool    ParseArgs( void );
165         // From CMICmnBase
166         /* dtor */ virtual ~CMICmdCmdVarDelete( void );
167
168 // Attribute:
169 private:
170         const CMIUtilString     m_constStrArgName;
171 };
172
173 //++ ============================================================================
174 // Details:     MI command class. MI commands derived from the command base class.
175 //                      *this class implements MI command "var-assign".
176 // Gotchas:     None.
177 // Authors:     Illya Rudkin 25/03/2014.
178 // Changes:     None.
179 //--
180 class CMICmdCmdVarAssign : public CMICmdBase
181 {
182 // Statics:
183 public:
184         // Required by the CMICmdFactory when registering *this command
185         static CMICmdBase *     CreateSelf( void );
186
187 // Methods:
188 public:
189         /* ctor */      CMICmdCmdVarAssign( void );
190
191 // Overridden:
192 public:
193         // From CMICmdInvoker::ICmd
194         virtual bool    Execute( void );
195         virtual bool    Acknowledge( void );
196         virtual bool    ParseArgs( void );
197         // From CMICmnBase
198         /* dtor */ virtual ~CMICmdCmdVarAssign( void );
199
200 // Attributes:
201 private:
202         bool                            m_bOk;                                          // True = success, false = failure
203         CMIUtilString           m_varObjName;
204         const CMIUtilString     m_constStrArgName;
205         const CMIUtilString     m_constStrArgExpression;        
206 };
207
208 //++ ============================================================================
209 // Details:     MI command class. MI commands derived from the command base class.
210 //                      *this class implements MI command "var-set-format".
211 // Gotchas:     None.
212 // Authors:     Illya Rudkin 26/03/2014.
213 // Changes:     None.
214 //--
215 class CMICmdCmdVarSetFormat : public CMICmdBase
216 {
217 // Statics:
218 public:
219         // Required by the CMICmdFactory when registering *this command
220         static CMICmdBase *     CreateSelf( void );
221
222 // Methods:
223 public:
224         /* ctor */      CMICmdCmdVarSetFormat( void );
225
226 // Overridden:
227 public:
228         // From CMICmdInvoker::ICmd
229         virtual bool    Execute( void );
230         virtual bool    Acknowledge( void );
231         virtual bool    ParseArgs( void );
232         // From CMICmnBase
233         /* dtor */ virtual ~CMICmdCmdVarSetFormat( void );
234
235 // Attributes:
236 private:
237         CMIUtilString           m_varObjName;
238         const CMIUtilString     m_constStrArgName;
239         const CMIUtilString     m_constStrArgFormatSpec;        
240 };
241
242 //++ ============================================================================
243 // Details:     MI command class. MI commands derived from the command base class.
244 //                      *this class implements MI command "var-list-children".
245 // Gotchas:     None.
246 // Authors:     Illya Rudkin 26/03/2014.
247 // Changes:     None.
248 //--
249 class CMICmdCmdVarListChildren : public CMICmdBase
250 {
251 // Statics:
252 public:
253         // Required by the CMICmdFactory when registering *this command
254         static CMICmdBase *     CreateSelf( void );
255
256 // Methods:
257 public:
258         /* ctor */      CMICmdCmdVarListChildren( void );
259
260 // Overridden:
261 public:
262         // From CMICmdInvoker::ICmd
263         virtual bool    Execute( void );
264         virtual bool    Acknowledge( void );
265         virtual bool    ParseArgs( void );
266         // From CMICmnBase
267         /* dtor */ virtual ~CMICmdCmdVarListChildren( void );
268
269 // Typedefs:
270 private:
271         typedef std::vector< CMICmnMIValueResult >      VecMIValueResult_t;
272
273 // Attributes:
274 private:
275         bool                            m_bValueValid;                          // True = yes SBValue object is valid, false = not valid
276         VecMIValueResult_t      m_vecMiValueResult;
277         MIuint                          m_nChildren;
278         const CMIUtilString     m_constStrArgPrintValues;       // Not handled by *this command
279         const CMIUtilString     m_constStrArgName;
280 };
281
282 //++ ============================================================================
283 // Details:     MI command class. MI commands derived from the command base class.
284 //                      *this class implements MI command "var-evaluate-expression".
285 // Gotchas:     None.
286 // Authors:     Illya Rudkin 26/03/2014.
287 // Changes:     None.
288 //--
289 class CMICmdCmdVarEvaluateExpression : public CMICmdBase
290 {
291 // Statics:
292 public:
293         // Required by the CMICmdFactory when registering *this command
294         static CMICmdBase *     CreateSelf( void );
295
296 // Methods:
297 public:
298         /* ctor */      CMICmdCmdVarEvaluateExpression( void );
299
300 // Overridden:
301 public:
302         // From CMICmdInvoker::ICmd
303         virtual bool    Execute( void );
304         virtual bool    Acknowledge( void );
305         virtual bool    ParseArgs( void );
306         // From CMICmnBase
307         /* dtor */ virtual ~CMICmdCmdVarEvaluateExpression( void );
308
309 // Attributes:
310 private:
311         bool                            m_bValueValid;                          // True = yes SBValue object is valid, false = not valid
312         CMIUtilString           m_varObjName;
313         const CMIUtilString     m_constStrArgFormatSpec;        // Not handled by *this command
314         const CMIUtilString     m_constStrArgName;
315 };
316
317 //++ ============================================================================
318 // Details:     MI command class. MI commands derived from the command base class.
319 //                      *this class implements MI command "var-info-path-expression".
320 // Gotchas:     None.
321 // Authors:     Illya Rudkin 26/03/2014.
322 // Changes:     None.
323 //--
324 class CMICmdCmdVarInfoPathExpression : public CMICmdBase
325 {
326 // Statics:
327 public:
328         // Required by the CMICmdFactory when registering *this command
329         static CMICmdBase *     CreateSelf( void );
330
331 // Methods:
332 public:
333         /* ctor */      CMICmdCmdVarInfoPathExpression( void );
334
335 // Overridden:
336 public:
337         // From CMICmdInvoker::ICmd
338         virtual bool    Execute( void );
339         virtual bool    Acknowledge( void );
340         virtual bool    ParseArgs( void );
341         // From CMICmnBase
342         /* dtor */ virtual ~CMICmdCmdVarInfoPathExpression( void );
343
344 // Attributes:
345 private:
346         bool                            m_bValueValid;                  // True = yes SBValue object is valid, false = not valid
347         CMIUtilString           m_strPathExpression;
348         const CMIUtilString     m_constStrArgName;
349 };
350
351 //++ ============================================================================
352 // Details:     MI command class. MI commands derived from the command base class.
353 //                      *this class implements MI command "var-show-attributes".
354 // Gotchas:     None.
355 // Authors:     Illya Rudkin 19/05/2014.
356 // Changes:     None.
357 //--
358 class CMICmdCmdVarShowAttributes : public CMICmdBase
359 {
360 // Statics:
361 public:
362         // Required by the CMICmdFactory when registering *this command
363         static CMICmdBase *     CreateSelf( void );
364
365 // Methods:
366 public:
367         /* ctor */      CMICmdCmdVarShowAttributes( void );
368
369 // Overridden:
370 public:
371         // From CMICmdInvoker::ICmd
372         virtual bool    Execute( void );
373         virtual bool    Acknowledge( void );
374         virtual bool    ParseArgs( void );
375         // From CMICmnBase
376         /* dtor */ virtual ~CMICmdCmdVarShowAttributes( void );
377
378 // Attributes:
379 private:
380         const CMIUtilString     m_constStrArgName;
381 };
382