1 //===-- MICmdCmdVar.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: MICmdCmdVar.h
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.
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"
45 #include "MICmnLLDBDebugSessionInfoVarObj.h"
48 class CMICmnLLDBDebugSessionInfoVarObj;
50 //++ ============================================================================
51 // Details: MI command class. MI commands derived from the command base class.
52 // *this class implements MI command "var-create".
54 // Authors: Illya Rudkin 24/03/2014.
57 class CMICmdCmdVarCreate : public CMICmdBase
61 // Required by the CMICmdFactory when registering *this command
62 static CMICmdBase * CreateSelf( void );
66 /* ctor */ CMICmdCmdVarCreate( void );
70 // From CMICmdInvoker::ICmd
71 virtual bool Execute( void );
72 virtual bool Acknowledge( void );
73 virtual bool ParseArgs( void );
75 /* dtor */ virtual ~CMICmdCmdVarCreate( void );
79 CMIUtilString m_strVarName;
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;
95 //++ ============================================================================
96 // Details: MI command class. MI commands derived from the command base class.
97 // *this class implements MI command "var-update".
99 // Authors: Illya Rudkin 25/03/2014.
102 class CMICmdCmdVarUpdate : public CMICmdBase
106 // Required by the CMICmdFactory when registering *this command
107 static CMICmdBase * CreateSelf( void );
111 /* ctor */ CMICmdCmdVarUpdate( void );
115 // From CMICmdInvoker::ICmd
116 virtual bool Execute( void );
117 virtual bool Acknowledge( void );
118 virtual bool ParseArgs( void );
123 /* dtor */ virtual ~CMICmdCmdVarUpdate( void );
127 bool ExamineSBValueForChange( const CMICmnLLDBDebugSessionInfoVarObj & vrVarObj, const bool vbIgnoreVarType, bool & vrwbChanged );
128 bool MIFormResponse( const CMIUtilString & vrStrVarName, const CMIUtilString & vrStrValue, const CMIUtilString & vrStrScope );
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;
141 //++ ============================================================================
142 // Details: MI command class. MI commands derived from the command base class.
143 // *this class implements MI command "var-delete".
145 // Authors: Illya Rudkin 25/03/2014.
148 class CMICmdCmdVarDelete : public CMICmdBase
152 // Required by the CMICmdFactory when registering *this command
153 static CMICmdBase * CreateSelf( void );
157 /* ctor */ CMICmdCmdVarDelete( void );
161 // From CMICmdInvoker::ICmd
162 virtual bool Execute( void );
163 virtual bool Acknowledge( void );
164 virtual bool ParseArgs( void );
166 /* dtor */ virtual ~CMICmdCmdVarDelete( void );
170 const CMIUtilString m_constStrArgName;
173 //++ ============================================================================
174 // Details: MI command class. MI commands derived from the command base class.
175 // *this class implements MI command "var-assign".
177 // Authors: Illya Rudkin 25/03/2014.
180 class CMICmdCmdVarAssign : public CMICmdBase
184 // Required by the CMICmdFactory when registering *this command
185 static CMICmdBase * CreateSelf( void );
189 /* ctor */ CMICmdCmdVarAssign( void );
193 // From CMICmdInvoker::ICmd
194 virtual bool Execute( void );
195 virtual bool Acknowledge( void );
196 virtual bool ParseArgs( void );
198 /* dtor */ virtual ~CMICmdCmdVarAssign( void );
202 bool m_bOk; // True = success, false = failure
203 CMIUtilString m_varObjName;
204 const CMIUtilString m_constStrArgName;
205 const CMIUtilString m_constStrArgExpression;
208 //++ ============================================================================
209 // Details: MI command class. MI commands derived from the command base class.
210 // *this class implements MI command "var-set-format".
212 // Authors: Illya Rudkin 26/03/2014.
215 class CMICmdCmdVarSetFormat : public CMICmdBase
219 // Required by the CMICmdFactory when registering *this command
220 static CMICmdBase * CreateSelf( void );
224 /* ctor */ CMICmdCmdVarSetFormat( void );
228 // From CMICmdInvoker::ICmd
229 virtual bool Execute( void );
230 virtual bool Acknowledge( void );
231 virtual bool ParseArgs( void );
233 /* dtor */ virtual ~CMICmdCmdVarSetFormat( void );
237 CMIUtilString m_varObjName;
238 const CMIUtilString m_constStrArgName;
239 const CMIUtilString m_constStrArgFormatSpec;
242 //++ ============================================================================
243 // Details: MI command class. MI commands derived from the command base class.
244 // *this class implements MI command "var-list-children".
246 // Authors: Illya Rudkin 26/03/2014.
249 class CMICmdCmdVarListChildren : public CMICmdBase
253 // Required by the CMICmdFactory when registering *this command
254 static CMICmdBase * CreateSelf( void );
258 /* ctor */ CMICmdCmdVarListChildren( void );
262 // From CMICmdInvoker::ICmd
263 virtual bool Execute( void );
264 virtual bool Acknowledge( void );
265 virtual bool ParseArgs( void );
267 /* dtor */ virtual ~CMICmdCmdVarListChildren( void );
271 typedef std::vector< CMICmnMIValueResult > VecMIValueResult_t;
275 bool m_bValueValid; // True = yes SBValue object is valid, false = not valid
276 VecMIValueResult_t m_vecMiValueResult;
278 const CMIUtilString m_constStrArgPrintValues; // Not handled by *this command
279 const CMIUtilString m_constStrArgName;
282 //++ ============================================================================
283 // Details: MI command class. MI commands derived from the command base class.
284 // *this class implements MI command "var-evaluate-expression".
286 // Authors: Illya Rudkin 26/03/2014.
289 class CMICmdCmdVarEvaluateExpression : public CMICmdBase
293 // Required by the CMICmdFactory when registering *this command
294 static CMICmdBase * CreateSelf( void );
298 /* ctor */ CMICmdCmdVarEvaluateExpression( void );
302 // From CMICmdInvoker::ICmd
303 virtual bool Execute( void );
304 virtual bool Acknowledge( void );
305 virtual bool ParseArgs( void );
307 /* dtor */ virtual ~CMICmdCmdVarEvaluateExpression( void );
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;
317 //++ ============================================================================
318 // Details: MI command class. MI commands derived from the command base class.
319 // *this class implements MI command "var-info-path-expression".
321 // Authors: Illya Rudkin 26/03/2014.
324 class CMICmdCmdVarInfoPathExpression : public CMICmdBase
328 // Required by the CMICmdFactory when registering *this command
329 static CMICmdBase * CreateSelf( void );
333 /* ctor */ CMICmdCmdVarInfoPathExpression( void );
337 // From CMICmdInvoker::ICmd
338 virtual bool Execute( void );
339 virtual bool Acknowledge( void );
340 virtual bool ParseArgs( void );
342 /* dtor */ virtual ~CMICmdCmdVarInfoPathExpression( void );
346 bool m_bValueValid; // True = yes SBValue object is valid, false = not valid
347 CMIUtilString m_strPathExpression;
348 const CMIUtilString m_constStrArgName;
351 //++ ============================================================================
352 // Details: MI command class. MI commands derived from the command base class.
353 // *this class implements MI command "var-show-attributes".
355 // Authors: Illya Rudkin 19/05/2014.
358 class CMICmdCmdVarShowAttributes : public CMICmdBase
362 // Required by the CMICmdFactory when registering *this command
363 static CMICmdBase * CreateSelf( void );
367 /* ctor */ CMICmdCmdVarShowAttributes( void );
371 // From CMICmdInvoker::ICmd
372 virtual bool Execute( void );
373 virtual bool Acknowledge( void );
374 virtual bool ParseArgs( void );
376 /* dtor */ virtual ~CMICmdCmdVarShowAttributes( void );
380 const CMIUtilString m_constStrArgName;