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 //===----------------------------------------------------------------------===//
10 // Overview: CMICmdCmdBreakInsert interface.
11 // CMICmdCmdBreakDelete interface.
12 // CMICmdCmdBreakDisable interface.
13 // CMICmdCmdBreakEnable interface.
14 // CMICmdCmdBreakAfter interface.
15 // CMICmdCmdBreakCondition interface.
17 // To implement new MI commands derive a new command class from the
19 // class. To enable the new command for interpretation add the new
21 // to the command factory. The files of relevance are:
25 // For an introduction to adding a new command see
26 // CMICmdCmdSupportInfoMiCmdQuery
27 // command class as an example.
31 // Third party headers:
32 #include "lldb/API/SBBreakpoint.h"
35 #include "MICmdBase.h"
38 //============================================================================
39 // Details: MI command class. MI commands derived from the command base class.
40 // *this class implements MI command "break-insert".
41 // This command does not follow the MI documentation exactly.
43 class CMICmdCmdBreakInsert : public CMICmdBase {
46 // Required by the CMICmdFactory when registering *this command
47 static CMICmdBase *CreateSelf();
51 /* ctor */ CMICmdCmdBreakInsert();
55 // From CMICmdInvoker::ICmd
56 bool Execute() override;
57 bool Acknowledge() override;
58 bool ParseArgs() override;
60 /* dtor */ ~CMICmdCmdBreakInsert() override;
64 //++ ===================================================================
65 // Details: The type of break point give in the MI command text.
68 eBreakPoint_Invalid = 0,
69 eBreakPoint_ByFileLine,
72 eBreakPoint_ByAddress,
74 eBreakPoint_NotDefineYet
80 bool m_bHaveArgOptionThreadGrp;
81 CMIUtilString m_brkName;
82 CMIUtilString m_strArgOptionThreadGrp;
83 lldb::SBBreakpoint m_brkPt;
84 bool m_bBrkPtIsPending;
85 MIuint m_nBrkPtIgnoreCount;
87 bool m_bBrkPtCondition;
88 CMIUtilString m_brkPtCondition;
89 bool m_bBrkPtThreadId;
90 MIuint m_nBrkPtThreadId;
91 const CMIUtilString m_constStrArgNamedTempBrkPt;
92 const CMIUtilString m_constStrArgNamedHWBrkPt; // Not handled by *this command
93 const CMIUtilString m_constStrArgNamedPendinfBrkPt;
94 const CMIUtilString m_constStrArgNamedDisableBrkPt;
95 const CMIUtilString m_constStrArgNamedTracePt; // Not handled by *this command
96 const CMIUtilString m_constStrArgNamedConditionalBrkPt;
97 const CMIUtilString m_constStrArgNamedInoreCnt;
98 const CMIUtilString m_constStrArgNamedRestrictBrkPtToThreadId;
99 const CMIUtilString m_constStrArgNamedLocation;
103 //============================================================================
104 // Details: MI command class. MI commands derived from the command base class.
105 // *this class implements MI command "break-delete".
107 class CMICmdCmdBreakDelete : public CMICmdBase {
110 // Required by the CMICmdFactory when registering *this command
111 static CMICmdBase *CreateSelf();
115 /* ctor */ CMICmdCmdBreakDelete();
119 // From CMICmdInvoker::ICmd
120 bool Execute() override;
121 bool Acknowledge() override;
122 bool ParseArgs() override;
124 /* dtor */ ~CMICmdCmdBreakDelete() override;
128 const CMIUtilString m_constStrArgNamedBrkPt;
132 //============================================================================
133 // Details: MI command class. MI commands derived from the command base class.
134 // *this class implements MI command "break-disable".
136 class CMICmdCmdBreakDisable : public CMICmdBase {
139 // Required by the CMICmdFactory when registering *this command
140 static CMICmdBase *CreateSelf();
144 /* ctor */ CMICmdCmdBreakDisable();
148 // From CMICmdInvoker::ICmd
149 bool Execute() override;
150 bool Acknowledge() override;
151 bool ParseArgs() override;
153 /* dtor */ ~CMICmdCmdBreakDisable() override;
157 const CMIUtilString m_constStrArgNamedBrkPt;
158 bool m_bBrkPtDisabledOk;
163 //============================================================================
164 // Details: MI command class. MI commands derived from the command base class.
165 // *this class implements MI command "break-enable".
167 class CMICmdCmdBreakEnable : public CMICmdBase {
170 // Required by the CMICmdFactory when registering *this command
171 static CMICmdBase *CreateSelf();
175 /* ctor */ CMICmdCmdBreakEnable();
179 // From CMICmdInvoker::ICmd
180 bool Execute() override;
181 bool Acknowledge() override;
182 bool ParseArgs() override;
184 /* dtor */ ~CMICmdCmdBreakEnable() override;
188 const CMIUtilString m_constStrArgNamedBrkPt;
189 bool m_bBrkPtEnabledOk;
194 //============================================================================
195 // Details: MI command class. MI commands derived from the command base class.
196 // *this class implements MI command "break-after".
198 class CMICmdCmdBreakAfter : public CMICmdBase {
201 // Required by the CMICmdFactory when registering *this command
202 static CMICmdBase *CreateSelf();
206 /* ctor */ CMICmdCmdBreakAfter();
210 // From CMICmdInvoker::ICmd
211 bool Execute() override;
212 bool Acknowledge() override;
213 bool ParseArgs() override;
215 /* dtor */ ~CMICmdCmdBreakAfter() override;
219 const CMIUtilString m_constStrArgNamedNumber;
220 const CMIUtilString m_constStrArgNamedCount;
222 MIuint m_nBrkPtCount;
226 //============================================================================
227 // Details: MI command class. MI commands derived from the command base class.
228 // *this class implements MI command "break-condition".
230 class CMICmdCmdBreakCondition : public CMICmdBase {
233 // Required by the CMICmdFactory when registering *this command
234 static CMICmdBase *CreateSelf();
238 /* ctor */ CMICmdCmdBreakCondition();
242 // From CMICmdInvoker::ICmd
243 bool Execute() override;
244 bool Acknowledge() override;
245 bool ParseArgs() override;
247 /* dtor */ ~CMICmdCmdBreakCondition() override;
251 CMIUtilString GetRestOfExpressionNotSurroundedInQuotes();
255 const CMIUtilString m_constStrArgNamedNumber;
256 const CMIUtilString m_constStrArgNamedExpr;
257 const CMIUtilString m_constStrArgNamedExprNoQuotes; // Not specified in MI
258 // spec, we need to handle
260 // surrounded by quotes
262 CMIUtilString m_strBrkPtExpr;