]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - tools/lldb-mi/MICmdCmdExec.h
Vendor import of lldb trunk r290819:
[FreeBSD/FreeBSD.git] / tools / lldb-mi / MICmdCmdExec.h
1 //===-- MICmdCmdExec.h ------------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
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.
20 //
21 //              To implement new MI commands derive a new command class from the
22 //              command base
23 //              class. To enable the new command for interpretation add the new
24 //              command class
25 //              to the command factory. The files of relevance are:
26 //                  MICmdCommands.cpp
27 //                  MICmdBase.h / .cpp
28 //                  MICmdCmd.h / .cpp
29 //              For an introduction to adding a new command see
30 //              CMICmdCmdSupportInfoMiCmdQuery
31 //              command class as an example.
32
33 #pragma once
34
35 // Third party headers:
36 #include "lldb/API/SBCommandReturnObject.h"
37
38 // In-house headers:
39 #include "MICmdBase.h"
40
41 //++
42 //============================================================================
43 // Details: MI command class. MI commands derived from the command base class.
44 //          *this class implements MI command "exec-run".
45 //--
46 class CMICmdCmdExecRun : public CMICmdBase {
47   // Statics:
48 public:
49   // Required by the CMICmdFactory when registering *this command
50   static CMICmdBase *CreateSelf();
51
52   // Methods:
53 public:
54   /* ctor */ CMICmdCmdExecRun();
55
56   // Overridden:
57 public:
58   // From CMICmdInvoker::ICmd
59   bool Execute() override;
60   bool Acknowledge() override;
61   bool ParseArgs() override;
62   // From CMICmnBase
63   /* dtor */ ~CMICmdCmdExecRun() override;
64
65   // Attributes:
66 private:
67   const CMIUtilString m_constStrArgStart; // StopAtEntry - run to first
68                                           // instruction or main() if specified
69   lldb::SBCommandReturnObject m_lldbResult;
70 };
71
72 //++
73 //============================================================================
74 // Details: MI command class. MI commands derived from the command base class.
75 //          *this class implements MI command "exec-continue".
76 //--
77 class CMICmdCmdExecContinue : public CMICmdBase {
78   // Statics:
79 public:
80   // Required by the CMICmdFactory when registering *this command
81   static CMICmdBase *CreateSelf();
82
83   // Methods:
84 public:
85   /* ctor */ CMICmdCmdExecContinue();
86
87   // Overridden:
88 public:
89   // From CMICmdInvoker::ICmd
90   bool Execute() override;
91   bool Acknowledge() override;
92   // From CMICmnBase
93   /* dtor */ ~CMICmdCmdExecContinue() override;
94
95   // Attributes:
96 private:
97   lldb::SBCommandReturnObject m_lldbResult;
98 };
99
100 //++
101 //============================================================================
102 // Details: MI command class. MI commands derived from the command base class.
103 //          *this class implements MI command "exec-next".
104 //--
105 class CMICmdCmdExecNext : public CMICmdBase {
106   // Statics:
107 public:
108   // Required by the CMICmdFactory when registering *this command
109   static CMICmdBase *CreateSelf();
110
111   // Methods:
112 public:
113   /* ctor */ CMICmdCmdExecNext();
114
115   // Overridden:
116 public:
117   // From CMICmdInvoker::ICmd
118   bool Execute() override;
119   bool Acknowledge() override;
120   bool ParseArgs() override;
121   // From CMICmnBase
122   /* dtor */ ~CMICmdCmdExecNext() override;
123
124   // Attributes:
125 private:
126   lldb::SBCommandReturnObject m_lldbResult;
127   const CMIUtilString m_constStrArgNumber; // Not specified in MI spec but
128                                            // Eclipse gives this option
129 };
130
131 //++
132 //============================================================================
133 // Details: MI command class. MI commands derived from the command base class.
134 //          *this class implements MI command "exec-step".
135 //--
136 class CMICmdCmdExecStep : public CMICmdBase {
137   // Statics:
138 public:
139   // Required by the CMICmdFactory when registering *this command
140   static CMICmdBase *CreateSelf();
141
142   // Methods:
143 public:
144   /* ctor */ CMICmdCmdExecStep();
145
146   // Overridden:
147 public:
148   // From CMICmdInvoker::ICmd
149   bool Execute() override;
150   bool Acknowledge() override;
151   bool ParseArgs() override;
152   // From CMICmnBase
153   /* dtor */ ~CMICmdCmdExecStep() override;
154
155   // Attributes:
156 private:
157   lldb::SBCommandReturnObject m_lldbResult;
158   const CMIUtilString m_constStrArgNumber; // Not specified in MI spec but
159                                            // Eclipse gives this option
160 };
161
162 //++
163 //============================================================================
164 // Details: MI command class. MI commands derived from the command base class.
165 //          *this class implements MI command "exec-next-instruction".
166 //--
167 class CMICmdCmdExecNextInstruction : public CMICmdBase {
168   // Statics:
169 public:
170   // Required by the CMICmdFactory when registering *this command
171   static CMICmdBase *CreateSelf();
172
173   // Methods:
174 public:
175   /* ctor */ CMICmdCmdExecNextInstruction();
176
177   // Overridden:
178 public:
179   // From CMICmdInvoker::ICmd
180   bool Execute() override;
181   bool Acknowledge() override;
182   bool ParseArgs() override;
183   // From CMICmnBase
184   /* dtor */ ~CMICmdCmdExecNextInstruction() override;
185
186   // Attributes:
187 private:
188   lldb::SBCommandReturnObject m_lldbResult;
189   const CMIUtilString m_constStrArgNumber; // Not specified in MI spec but
190                                            // Eclipse gives this option
191 };
192
193 //++
194 //============================================================================
195 // Details: MI command class. MI commands derived from the command base class.
196 //          *this class implements MI command "exec-step-instruction".
197 //--
198 class CMICmdCmdExecStepInstruction : public CMICmdBase {
199   // Statics:
200 public:
201   // Required by the CMICmdFactory when registering *this command
202   static CMICmdBase *CreateSelf();
203
204   // Methods:
205 public:
206   /* ctor */ CMICmdCmdExecStepInstruction();
207
208   // Overridden:
209 public:
210   // From CMICmdInvoker::ICmd
211   bool Execute() override;
212   bool Acknowledge() override;
213   bool ParseArgs() override;
214   // From CMICmnBase
215   /* dtor */ ~CMICmdCmdExecStepInstruction() override;
216
217   // Attributes:
218 private:
219   lldb::SBCommandReturnObject m_lldbResult;
220   const CMIUtilString m_constStrArgNumber; // Not specified in MI spec but
221                                            // Eclipse gives this option
222 };
223
224 //++
225 //============================================================================
226 // Details: MI command class. MI commands derived from the command base class.
227 //          *this class implements MI command "exec-finish".
228 //--
229 class CMICmdCmdExecFinish : public CMICmdBase {
230   // Statics:
231 public:
232   // Required by the CMICmdFactory when registering *this command
233   static CMICmdBase *CreateSelf();
234
235   // Methods:
236 public:
237   /* ctor */ CMICmdCmdExecFinish();
238
239   // Overridden:
240 public:
241   // From CMICmdInvoker::ICmd
242   bool Execute() override;
243   bool Acknowledge() override;
244   bool ParseArgs() override;
245   // From CMICmnBase
246   /* dtor */ ~CMICmdCmdExecFinish() override;
247
248   // Attributes:
249 private:
250   lldb::SBCommandReturnObject m_lldbResult;
251 };
252
253 // CODETAG_DEBUG_SESSION_RUNNING_PROG_RECEIVED_SIGINT_PAUSE_PROGRAM
254 //++
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
259 // a
260 //          SIGINT signal is received while running an inferior program.
261 //--
262 class CMICmdCmdExecInterrupt : public CMICmdBase {
263   // Statics:
264 public:
265   // Required by the CMICmdFactory when registering *this command
266   static CMICmdBase *CreateSelf();
267
268   // Methods:
269 public:
270   /* ctor */ CMICmdCmdExecInterrupt();
271
272   // Overridden:
273 public:
274   // From CMICmdInvoker::ICmd
275   bool Execute() override;
276   bool Acknowledge() override;
277   // From CMICmnBase
278   /* dtor */ ~CMICmdCmdExecInterrupt() override;
279
280   // Attributes:
281 private:
282   lldb::SBCommandReturnObject m_lldbResult;
283 };
284
285 //++
286 //============================================================================
287 // Details: MI command class. MI commands derived from the command base class.
288 //          *this class implements MI command "exec-arguments".
289 //--
290 class CMICmdCmdExecArguments : public CMICmdBase {
291   // Statics:
292 public:
293   // Required by the CMICmdFactory when registering *this command
294   static CMICmdBase *CreateSelf();
295
296   // Methods:
297 public:
298   /* ctor */ CMICmdCmdExecArguments();
299
300   // Overridden:
301 public:
302   // From CMICmdInvoker::ICmd
303   bool Execute() override;
304   bool Acknowledge() override;
305   bool ParseArgs() override;
306   // From CMICmnBase
307   /* dtor */ ~CMICmdCmdExecArguments() override;
308
309   // Attributes:
310 private:
311   const CMIUtilString m_constStrArgArguments;
312 };
313
314 //++
315 //============================================================================
316 // Details: MI command class. MI commands derived from the command base class.
317 //          *this class implements MI command "exec-abort".
318 //--
319 class CMICmdCmdExecAbort : public CMICmdBase {
320   // Statics:
321 public:
322   // Required by the CMICmdFactory when registering *this command
323   static CMICmdBase *CreateSelf();
324
325   // Methods:
326 public:
327   /* ctor */ CMICmdCmdExecAbort();
328
329   // Overridden:
330 public:
331   // From CMICmdInvoker::ICmd
332   bool Execute() override;
333   bool Acknowledge() override;
334   // From CMICmnBase
335   /* dtor */ ~CMICmdCmdExecAbort() override;
336 };