1 //===-- MICmdCmdBreak.h -----------------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // Overview: CMICmdCmdBreakInsert interface.
10 // CMICmdCmdBreakDelete interface.
11 // CMICmdCmdBreakDisable interface.
12 // CMICmdCmdBreakEnable interface.
13 // CMICmdCmdBreakAfter interface.
14 // CMICmdCmdBreakCondition interface.
16 // To implement new MI commands derive a new command class from the
18 // class. To enable the new command for interpretation add the new
20 // to the command factory. The files of relevance are:
24 // For an introduction to adding a new command see
25 // CMICmdCmdSupportInfoMiCmdQuery
26 // command class as an example.
30 // Third party headers:
31 #include "lldb/API/SBBreakpoint.h"
34 #include "MICmdBase.h"
37 //============================================================================
38 // Details: MI command class. MI commands derived from the command base class.
39 // *this class implements MI command "break-insert".
40 // This command does not follow the MI documentation exactly.
42 class CMICmdCmdBreakInsert : public CMICmdBase {
45 // Required by the CMICmdFactory when registering *this command
46 static CMICmdBase *CreateSelf();
50 /* ctor */ CMICmdCmdBreakInsert();
54 // From CMICmdInvoker::ICmd
55 bool Execute() override;
56 bool Acknowledge() override;
57 bool ParseArgs() override;
59 /* dtor */ ~CMICmdCmdBreakInsert() override;
63 //++ ===================================================================
64 // Details: The type of break point give in the MI command text.
67 eBreakPoint_Invalid = 0,
68 eBreakPoint_ByFileLine,
71 eBreakPoint_ByAddress,
73 eBreakPoint_NotDefineYet
79 bool m_bHaveArgOptionThreadGrp;
80 CMIUtilString m_brkName;
81 CMIUtilString m_strArgOptionThreadGrp;
82 lldb::SBBreakpoint m_brkPt;
83 bool m_bBrkPtIsPending;
84 MIuint m_nBrkPtIgnoreCount;
86 bool m_bBrkPtCondition;
87 CMIUtilString m_brkPtCondition;
88 bool m_bBrkPtThreadId;
89 MIuint m_nBrkPtThreadId;
90 const CMIUtilString m_constStrArgNamedTempBrkPt;
91 const CMIUtilString m_constStrArgNamedHWBrkPt; // Not handled by *this command
92 const CMIUtilString m_constStrArgNamedPendinfBrkPt;
93 const CMIUtilString m_constStrArgNamedDisableBrkPt;
94 const CMIUtilString m_constStrArgNamedTracePt; // Not handled by *this command
95 const CMIUtilString m_constStrArgNamedConditionalBrkPt;
96 const CMIUtilString m_constStrArgNamedInoreCnt;
97 const CMIUtilString m_constStrArgNamedRestrictBrkPtToThreadId;
98 const CMIUtilString m_constStrArgNamedLocation;
102 //============================================================================
103 // Details: MI command class. MI commands derived from the command base class.
104 // *this class implements MI command "break-delete".
106 class CMICmdCmdBreakDelete : public CMICmdBase {
109 // Required by the CMICmdFactory when registering *this command
110 static CMICmdBase *CreateSelf();
114 /* ctor */ CMICmdCmdBreakDelete();
118 // From CMICmdInvoker::ICmd
119 bool Execute() override;
120 bool Acknowledge() override;
121 bool ParseArgs() override;
123 /* dtor */ ~CMICmdCmdBreakDelete() override;
127 const CMIUtilString m_constStrArgNamedBrkPt;
131 //============================================================================
132 // Details: MI command class. MI commands derived from the command base class.
133 // *this class implements MI command "break-disable".
135 class CMICmdCmdBreakDisable : public CMICmdBase {
138 // Required by the CMICmdFactory when registering *this command
139 static CMICmdBase *CreateSelf();
143 /* ctor */ CMICmdCmdBreakDisable();
147 // From CMICmdInvoker::ICmd
148 bool Execute() override;
149 bool Acknowledge() override;
150 bool ParseArgs() override;
152 /* dtor */ ~CMICmdCmdBreakDisable() override;
156 const CMIUtilString m_constStrArgNamedBrkPt;
157 bool m_bBrkPtDisabledOk;
162 //============================================================================
163 // Details: MI command class. MI commands derived from the command base class.
164 // *this class implements MI command "break-enable".
166 class CMICmdCmdBreakEnable : public CMICmdBase {
169 // Required by the CMICmdFactory when registering *this command
170 static CMICmdBase *CreateSelf();
174 /* ctor */ CMICmdCmdBreakEnable();
178 // From CMICmdInvoker::ICmd
179 bool Execute() override;
180 bool Acknowledge() override;
181 bool ParseArgs() override;
183 /* dtor */ ~CMICmdCmdBreakEnable() override;
187 const CMIUtilString m_constStrArgNamedBrkPt;
188 bool m_bBrkPtEnabledOk;
193 //============================================================================
194 // Details: MI command class. MI commands derived from the command base class.
195 // *this class implements MI command "break-after".
197 class CMICmdCmdBreakAfter : public CMICmdBase {
200 // Required by the CMICmdFactory when registering *this command
201 static CMICmdBase *CreateSelf();
205 /* ctor */ CMICmdCmdBreakAfter();
209 // From CMICmdInvoker::ICmd
210 bool Execute() override;
211 bool Acknowledge() override;
212 bool ParseArgs() override;
214 /* dtor */ ~CMICmdCmdBreakAfter() override;
218 const CMIUtilString m_constStrArgNamedNumber;
219 const CMIUtilString m_constStrArgNamedCount;
221 MIuint m_nBrkPtCount;
225 //============================================================================
226 // Details: MI command class. MI commands derived from the command base class.
227 // *this class implements MI command "break-condition".
229 class CMICmdCmdBreakCondition : public CMICmdBase {
232 // Required by the CMICmdFactory when registering *this command
233 static CMICmdBase *CreateSelf();
237 /* ctor */ CMICmdCmdBreakCondition();
241 // From CMICmdInvoker::ICmd
242 bool Execute() override;
243 bool Acknowledge() override;
244 bool ParseArgs() override;
246 /* dtor */ ~CMICmdCmdBreakCondition() override;
250 CMIUtilString GetRestOfExpressionNotSurroundedInQuotes();
254 const CMIUtilString m_constStrArgNamedNumber;
255 const CMIUtilString m_constStrArgNamedExpr;
256 const CMIUtilString m_constStrArgNamedExprNoQuotes; // Not specified in MI
257 // spec, we need to handle
259 // surrounded by quotes
261 CMIUtilString m_strBrkPtExpr;