1 //===-- MICmdCmdBreak.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: MICmdCmdBreak.h
13 // Overview: CMICmdCmdBreakInsert interface.
14 // CMICmdCmdBreakDelete interface.
15 // CMICmdCmdBreakDisable interface.
16 // CMICmdCmdBreakEnable interface.
17 // CMICmdCmdBreakAfter interface.
18 // CMICmdCmdBreakCondition interface.
20 // To implement new MI commands derive a new command class from the command base
21 // class. To enable the new command for interpretation add the new command class
22 // to the command factory. The files of relevance are:
26 // For an introduction to adding a new command see CMICmdCmdSupportInfoMiCmdQuery
27 // command class as an example.
29 // Environment: Compilers: Visual C++ 12.
30 // gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
31 // Libraries: See MIReadmetxt.
38 // Third party headers:
39 #include <lldb/API/SBBreakpoint.h>
42 #include "MICmdBase.h"
44 //++ ============================================================================
45 // Details: MI command class. MI commands derived from the command base class.
46 // *this class implements MI command "break-insert".
47 // This command does not follow the MI documentation exactly.
49 // Authors: Illya Rudkin 11/03/2014.
52 class CMICmdCmdBreakInsert : public CMICmdBase
56 // Required by the CMICmdFactory when registering *this command
57 static CMICmdBase * CreateSelf( void );
61 /* ctor */ CMICmdCmdBreakInsert( void );
65 // From CMICmdInvoker::ICmd
66 virtual bool Execute( void );
67 virtual bool Acknowledge( void );
68 virtual bool ParseArgs( void );
70 /* dtor */ virtual ~CMICmdCmdBreakInsert( void );
74 //++ ===================================================================
75 // Details: The type of break point give in the MI command text.
79 eBreakPoint_Invalid = 0,
80 eBreakPoint_ByFileLine,
83 eBreakPoint_ByAddress,
85 eBreakPoint_NotDefineYet
91 bool m_bHaveArgOptionThreadGrp;
92 CMIUtilString m_brkName;
93 CMIUtilString m_strArgOptionThreadGrp;
94 lldb::SBBreakpoint m_brkPt;
95 bool m_bBrkPtIsPending;
96 MIuint m_nBrkPtIgnoreCount;
98 bool m_bBrkPtCondition;
99 CMIUtilString m_brkPtCondition;
100 bool m_bBrkPtThreadId;
101 MIuint m_nBrkPtThreadId;
102 const CMIUtilString m_constStrArgNamedTempBrkPt;
103 const CMIUtilString m_constStrArgNamedHWBrkPt; // Not handled by *this command
104 const CMIUtilString m_constStrArgNamedPendinfBrkPt;
105 const CMIUtilString m_constStrArgNamedDisableBrkPt;
106 const CMIUtilString m_constStrArgNamedTracePt; // Not handled by *this command
107 const CMIUtilString m_constStrArgNamedConditionalBrkPt;
108 const CMIUtilString m_constStrArgNamedInoreCnt;
109 const CMIUtilString m_constStrArgNamedRestrictBrkPtToThreadId;
110 const CMIUtilString m_constStrArgNamedLocation;
111 const CMIUtilString m_constStrArgNamedThreadGroup; // Not specified in MI spec but Eclipse gives this option sometimes
114 //++ ============================================================================
115 // Details: MI command class. MI commands derived from the command base class.
116 // *this class implements MI command "break-delete".
118 // Authors: Illya Rudkin 11/03/2014.
121 class CMICmdCmdBreakDelete : public CMICmdBase
125 // Required by the CMICmdFactory when registering *this command
126 static CMICmdBase * CreateSelf( void );
130 /* ctor */ CMICmdCmdBreakDelete( void );
134 // From CMICmdInvoker::ICmd
135 virtual bool Execute( void );
136 virtual bool Acknowledge( void );
137 virtual bool ParseArgs( void );
139 /* dtor */ virtual ~CMICmdCmdBreakDelete( void );
143 const CMIUtilString m_constStrArgNamedBrkPt;
144 const CMIUtilString m_constStrArgNamedThreadGrp; // Not specified in MI spec but Eclipse gives this option
147 //++ ============================================================================
148 // Details: MI command class. MI commands derived from the command base class.
149 // *this class implements MI command "break-disable".
151 // Authors: Illya Rudkin 19/05/2014.
154 class CMICmdCmdBreakDisable : public CMICmdBase
158 // Required by the CMICmdFactory when registering *this command
159 static CMICmdBase * CreateSelf( void );
163 /* ctor */ CMICmdCmdBreakDisable( void );
167 // From CMICmdInvoker::ICmd
168 virtual bool Execute( void );
169 virtual bool Acknowledge( void );
170 virtual bool ParseArgs( void );
172 /* dtor */ virtual ~CMICmdCmdBreakDisable( void );
176 const CMIUtilString m_constStrArgNamedThreadGrp; // Not specified in MI spec but Eclipse gives this option
177 const CMIUtilString m_constStrArgNamedBrkPt;
178 bool m_bBrkPtDisabledOk;
182 //++ ============================================================================
183 // Details: MI command class. MI commands derived from the command base class.
184 // *this class implements MI command "break-enable".
186 // Authors: Illya Rudkin 19/05/2014.
189 class CMICmdCmdBreakEnable : public CMICmdBase
193 // Required by the CMICmdFactory when registering *this command
194 static CMICmdBase * CreateSelf( void );
198 /* ctor */ CMICmdCmdBreakEnable( void );
202 // From CMICmdInvoker::ICmd
203 virtual bool Execute( void );
204 virtual bool Acknowledge( void );
205 virtual bool ParseArgs( void );
207 /* dtor */ virtual ~CMICmdCmdBreakEnable( void );
211 const CMIUtilString m_constStrArgNamedThreadGrp; // Not specified in MI spec but Eclipse gives this option
212 const CMIUtilString m_constStrArgNamedBrkPt;
213 bool m_bBrkPtEnabledOk;
217 //++ ============================================================================
218 // Details: MI command class. MI commands derived from the command base class.
219 // *this class implements MI command "break-after".
221 // Authors: Illya Rudkin 29/05/2014.
224 class CMICmdCmdBreakAfter : public CMICmdBase
228 // Required by the CMICmdFactory when registering *this command
229 static CMICmdBase * CreateSelf( void );
233 /* ctor */ CMICmdCmdBreakAfter( void );
237 // From CMICmdInvoker::ICmd
238 virtual bool Execute( void );
239 virtual bool Acknowledge( void );
240 virtual bool ParseArgs( void );
242 /* dtor */ virtual ~CMICmdCmdBreakAfter( void );
246 const CMIUtilString m_constStrArgNamedThreadGrp; // Not specified in MI spec but Eclipse gives this option
247 const CMIUtilString m_constStrArgNamedNumber;
248 const CMIUtilString m_constStrArgNamedCount;
250 MIuint m_nBrkPtCount;
253 //++ ============================================================================
254 // Details: MI command class. MI commands derived from the command base class.
255 // *this class implements MI command "break-condition".
257 // Authors: Illya Rudkin 29/05/2014.
260 class CMICmdCmdBreakCondition : public CMICmdBase
264 // Required by the CMICmdFactory when registering *this command
265 static CMICmdBase * CreateSelf( void );
269 /* ctor */ CMICmdCmdBreakCondition( void );
273 // From CMICmdInvoker::ICmd
274 virtual bool Execute( void );
275 virtual bool Acknowledge( void );
276 virtual bool ParseArgs( void );
278 /* dtor */ virtual ~CMICmdCmdBreakCondition( void );
282 CMIUtilString GetRestOfExpressionNotSurroundedInQuotes( void );
286 const CMIUtilString m_constStrArgNamedThreadGrp; // Not specified in MI spec but Eclipse gives this option
287 const CMIUtilString m_constStrArgNamedNumber;
288 const CMIUtilString m_constStrArgNamedExpr;
289 const CMIUtilString m_constStrArgNamedExprNoQuotes; // Not specified in MI spec, we need to handle expressions not surrounded by quotes
291 CMIUtilString m_strBrkPtExpr;