1 //===-- MICmdCmdExec.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: CMICmdCmdExecRun interface.
11 // CMICmdCmdExecContinue interface.
12 // CMICmdCmdExecNext interface.
13 // CMICmdCmdExecStep interface.
14 // CMICmdCmdExecNextInstruction interface.
15 // CMICmdCmdExecStepInstruction interface.
16 // CMICmdCmdExecFinish interface.
17 // CMICmdCmdExecInterrupt interface.
18 // CMICmdCmdExecArguments interface.
19 // CMICmdCmdExecAbort interface.
21 // To implement new MI commands derive a new command class from the
23 // class. To enable the new command for interpretation add the new
25 // to the command factory. The files of relevance are:
29 // For an introduction to adding a new command see
30 // CMICmdCmdSupportInfoMiCmdQuery
31 // command class as an example.
35 // Third party headers:
36 #include "lldb/API/SBCommandReturnObject.h"
39 #include "MICmdBase.h"
42 //============================================================================
43 // Details: MI command class. MI commands derived from the command base class.
44 // *this class implements MI command "exec-run".
46 class CMICmdCmdExecRun : public CMICmdBase {
49 // Required by the CMICmdFactory when registering *this command
50 static CMICmdBase *CreateSelf();
54 /* ctor */ CMICmdCmdExecRun();
58 // From CMICmdInvoker::ICmd
59 bool Execute() override;
60 bool Acknowledge() override;
61 bool ParseArgs() override;
63 /* dtor */ ~CMICmdCmdExecRun() override;
67 const CMIUtilString m_constStrArgStart; // StopAtEntry - run to first
68 // instruction or main() if specified
69 lldb::SBCommandReturnObject m_lldbResult;
73 //============================================================================
74 // Details: MI command class. MI commands derived from the command base class.
75 // *this class implements MI command "exec-continue".
77 class CMICmdCmdExecContinue : public CMICmdBase {
80 // Required by the CMICmdFactory when registering *this command
81 static CMICmdBase *CreateSelf();
85 /* ctor */ CMICmdCmdExecContinue();
89 // From CMICmdInvoker::ICmd
90 bool Execute() override;
91 bool Acknowledge() override;
93 /* dtor */ ~CMICmdCmdExecContinue() override;
97 lldb::SBCommandReturnObject m_lldbResult;
101 //============================================================================
102 // Details: MI command class. MI commands derived from the command base class.
103 // *this class implements MI command "exec-next".
105 class CMICmdCmdExecNext : public CMICmdBase {
108 // Required by the CMICmdFactory when registering *this command
109 static CMICmdBase *CreateSelf();
113 /* ctor */ CMICmdCmdExecNext();
117 // From CMICmdInvoker::ICmd
118 bool Execute() override;
119 bool Acknowledge() override;
120 bool ParseArgs() override;
122 /* dtor */ ~CMICmdCmdExecNext() override;
126 lldb::SBCommandReturnObject m_lldbResult;
127 const CMIUtilString m_constStrArgNumber; // Not specified in MI spec but
128 // Eclipse gives this option
132 //============================================================================
133 // Details: MI command class. MI commands derived from the command base class.
134 // *this class implements MI command "exec-step".
136 class CMICmdCmdExecStep : public CMICmdBase {
139 // Required by the CMICmdFactory when registering *this command
140 static CMICmdBase *CreateSelf();
144 /* ctor */ CMICmdCmdExecStep();
148 // From CMICmdInvoker::ICmd
149 bool Execute() override;
150 bool Acknowledge() override;
151 bool ParseArgs() override;
153 /* dtor */ ~CMICmdCmdExecStep() override;
157 lldb::SBCommandReturnObject m_lldbResult;
158 const CMIUtilString m_constStrArgNumber; // Not specified in MI spec but
159 // Eclipse gives this option
163 //============================================================================
164 // Details: MI command class. MI commands derived from the command base class.
165 // *this class implements MI command "exec-next-instruction".
167 class CMICmdCmdExecNextInstruction : public CMICmdBase {
170 // Required by the CMICmdFactory when registering *this command
171 static CMICmdBase *CreateSelf();
175 /* ctor */ CMICmdCmdExecNextInstruction();
179 // From CMICmdInvoker::ICmd
180 bool Execute() override;
181 bool Acknowledge() override;
182 bool ParseArgs() override;
184 /* dtor */ ~CMICmdCmdExecNextInstruction() override;
188 lldb::SBCommandReturnObject m_lldbResult;
189 const CMIUtilString m_constStrArgNumber; // Not specified in MI spec but
190 // Eclipse gives this option
194 //============================================================================
195 // Details: MI command class. MI commands derived from the command base class.
196 // *this class implements MI command "exec-step-instruction".
198 class CMICmdCmdExecStepInstruction : public CMICmdBase {
201 // Required by the CMICmdFactory when registering *this command
202 static CMICmdBase *CreateSelf();
206 /* ctor */ CMICmdCmdExecStepInstruction();
210 // From CMICmdInvoker::ICmd
211 bool Execute() override;
212 bool Acknowledge() override;
213 bool ParseArgs() override;
215 /* dtor */ ~CMICmdCmdExecStepInstruction() override;
219 lldb::SBCommandReturnObject m_lldbResult;
220 const CMIUtilString m_constStrArgNumber; // Not specified in MI spec but
221 // Eclipse gives this option
225 //============================================================================
226 // Details: MI command class. MI commands derived from the command base class.
227 // *this class implements MI command "exec-finish".
229 class CMICmdCmdExecFinish : public CMICmdBase {
232 // Required by the CMICmdFactory when registering *this command
233 static CMICmdBase *CreateSelf();
237 /* ctor */ CMICmdCmdExecFinish();
241 // From CMICmdInvoker::ICmd
242 bool Execute() override;
243 bool Acknowledge() override;
244 bool ParseArgs() override;
246 /* dtor */ ~CMICmdCmdExecFinish() override;
250 lldb::SBCommandReturnObject m_lldbResult;
253 // CODETAG_DEBUG_SESSION_RUNNING_PROG_RECEIVED_SIGINT_PAUSE_PROGRAM
255 //============================================================================
256 // Details: MI command class. MI commands derived from the command base class.
257 // *this class implements MI command "exec-interrupt".
258 // Gotchas: Using Eclipse this command is injected into the command system when
260 // SIGINT signal is received while running an inferior program.
262 class CMICmdCmdExecInterrupt : public CMICmdBase {
265 // Required by the CMICmdFactory when registering *this command
266 static CMICmdBase *CreateSelf();
270 /* ctor */ CMICmdCmdExecInterrupt();
274 // From CMICmdInvoker::ICmd
275 bool Execute() override;
276 bool Acknowledge() override;
278 /* dtor */ ~CMICmdCmdExecInterrupt() override;
282 lldb::SBCommandReturnObject m_lldbResult;
286 //============================================================================
287 // Details: MI command class. MI commands derived from the command base class.
288 // *this class implements MI command "exec-arguments".
290 class CMICmdCmdExecArguments : public CMICmdBase {
293 // Required by the CMICmdFactory when registering *this command
294 static CMICmdBase *CreateSelf();
298 /* ctor */ CMICmdCmdExecArguments();
302 // From CMICmdInvoker::ICmd
303 bool Execute() override;
304 bool Acknowledge() override;
305 bool ParseArgs() override;
307 /* dtor */ ~CMICmdCmdExecArguments() override;
311 const CMIUtilString m_constStrArgArguments;
315 //============================================================================
316 // Details: MI command class. MI commands derived from the command base class.
317 // *this class implements MI command "exec-abort".
319 class CMICmdCmdExecAbort : public CMICmdBase {
322 // Required by the CMICmdFactory when registering *this command
323 static CMICmdBase *CreateSelf();
327 /* ctor */ CMICmdCmdExecAbort();
331 // From CMICmdInvoker::ICmd
332 bool Execute() override;
333 bool Acknowledge() override;
335 /* dtor */ ~CMICmdCmdExecAbort() override;