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 // In-house headers:
37 #include "MICmdBase.h"
38 
39 //++
40 //============================================================================
41 // Details: MI command class. MI commands derived from the command base class.
42 //          *this class implements MI command "exec-run".
43 //--
44 class CMICmdCmdExecRun : public CMICmdBase {
45   // Statics:
46 public:
47   // Required by the CMICmdFactory when registering *this command
48   static CMICmdBase *CreateSelf();
49 
50   // Methods:
51 public:
52   /* ctor */ CMICmdCmdExecRun();
53 
54   // Overridden:
55 public:
56   // From CMICmdInvoker::ICmd
57   bool Execute() override;
58   bool Acknowledge() override;
59   bool ParseArgs() override;
60   // From CMICmnBase
61   /* dtor */ ~CMICmdCmdExecRun() override;
62 
63   // Attributes:
64 private:
65   const CMIUtilString m_constStrArgStart; // StopAtEntry - run to first
66                                           // instruction or main() if specified
67 };
68 
69 //++
70 //============================================================================
71 // Details: MI command class. MI commands derived from the command base class.
72 //          *this class implements MI command "exec-continue".
73 //--
74 class CMICmdCmdExecContinue : public CMICmdBase {
75   // Statics:
76 public:
77   // Required by the CMICmdFactory when registering *this command
78   static CMICmdBase *CreateSelf();
79 
80   // Methods:
81 public:
82   /* ctor */ CMICmdCmdExecContinue();
83 
84   // Overridden:
85 public:
86   // From CMICmdInvoker::ICmd
87   bool Execute() override;
88   bool Acknowledge() override;
89   // From CMICmnBase
90   /* dtor */ ~CMICmdCmdExecContinue() override;
91 };
92 
93 //++
94 //============================================================================
95 // Details: MI command class. MI commands derived from the command base class.
96 //          *this class implements MI command "exec-next".
97 //--
98 class CMICmdCmdExecNext : public CMICmdBase {
99   // Statics:
100 public:
101   // Required by the CMICmdFactory when registering *this command
102   static CMICmdBase *CreateSelf();
103 
104   // Methods:
105 public:
106   /* ctor */ CMICmdCmdExecNext();
107 
108   // Overridden:
109 public:
110   // From CMICmdInvoker::ICmd
111   bool Execute() override;
112   bool Acknowledge() override;
113   bool ParseArgs() override;
114   // From CMICmnBase
115   /* dtor */ ~CMICmdCmdExecNext() override;
116 
117   // Attributes:
118 private:
119   const CMIUtilString m_constStrArgNumber; // Not specified in MI spec but
120                                            // Eclipse gives this option
121 };
122 
123 //++
124 //============================================================================
125 // Details: MI command class. MI commands derived from the command base class.
126 //          *this class implements MI command "exec-step".
127 //--
128 class CMICmdCmdExecStep : public CMICmdBase {
129   // Statics:
130 public:
131   // Required by the CMICmdFactory when registering *this command
132   static CMICmdBase *CreateSelf();
133 
134   // Methods:
135 public:
136   /* ctor */ CMICmdCmdExecStep();
137 
138   // Overridden:
139 public:
140   // From CMICmdInvoker::ICmd
141   bool Execute() override;
142   bool Acknowledge() override;
143   bool ParseArgs() override;
144   // From CMICmnBase
145   /* dtor */ ~CMICmdCmdExecStep() override;
146 
147   // Attributes:
148 private:
149   const CMIUtilString m_constStrArgNumber; // Not specified in MI spec but
150                                            // Eclipse gives this option
151 };
152 
153 //++
154 //============================================================================
155 // Details: MI command class. MI commands derived from the command base class.
156 //          *this class implements MI command "exec-next-instruction".
157 //--
158 class CMICmdCmdExecNextInstruction : public CMICmdBase {
159   // Statics:
160 public:
161   // Required by the CMICmdFactory when registering *this command
162   static CMICmdBase *CreateSelf();
163 
164   // Methods:
165 public:
166   /* ctor */ CMICmdCmdExecNextInstruction();
167 
168   // Overridden:
169 public:
170   // From CMICmdInvoker::ICmd
171   bool Execute() override;
172   bool Acknowledge() override;
173   bool ParseArgs() override;
174   // From CMICmnBase
175   /* dtor */ ~CMICmdCmdExecNextInstruction() override;
176 
177   // Attributes:
178 private:
179   const CMIUtilString m_constStrArgNumber; // Not specified in MI spec but
180                                            // Eclipse gives this option
181 };
182 
183 //++
184 //============================================================================
185 // Details: MI command class. MI commands derived from the command base class.
186 //          *this class implements MI command "exec-step-instruction".
187 //--
188 class CMICmdCmdExecStepInstruction : public CMICmdBase {
189   // Statics:
190 public:
191   // Required by the CMICmdFactory when registering *this command
192   static CMICmdBase *CreateSelf();
193 
194   // Methods:
195 public:
196   /* ctor */ CMICmdCmdExecStepInstruction();
197 
198   // Overridden:
199 public:
200   // From CMICmdInvoker::ICmd
201   bool Execute() override;
202   bool Acknowledge() override;
203   bool ParseArgs() override;
204   // From CMICmnBase
205   /* dtor */ ~CMICmdCmdExecStepInstruction() override;
206 
207   // Attributes:
208 private:
209   const CMIUtilString m_constStrArgNumber; // Not specified in MI spec but
210                                            // Eclipse gives this option
211 };
212 
213 //++
214 //============================================================================
215 // Details: MI command class. MI commands derived from the command base class.
216 //          *this class implements MI command "exec-finish".
217 //--
218 class CMICmdCmdExecFinish : public CMICmdBase {
219   // Statics:
220 public:
221   // Required by the CMICmdFactory when registering *this command
222   static CMICmdBase *CreateSelf();
223 
224   // Methods:
225 public:
226   /* ctor */ CMICmdCmdExecFinish();
227 
228   // Overridden:
229 public:
230   // From CMICmdInvoker::ICmd
231   bool Execute() override;
232   bool Acknowledge() override;
233   bool ParseArgs() override;
234   // From CMICmnBase
235   /* dtor */ ~CMICmdCmdExecFinish() override;
236 };
237 
238 // CODETAG_DEBUG_SESSION_RUNNING_PROG_RECEIVED_SIGINT_PAUSE_PROGRAM
239 //++
240 //============================================================================
241 // Details: MI command class. MI commands derived from the command base class.
242 //          *this class implements MI command "exec-interrupt".
243 // Gotchas: Using Eclipse this command is injected into the command system when
244 // a
245 //          SIGINT signal is received while running an inferior program.
246 //--
247 class CMICmdCmdExecInterrupt : public CMICmdBase {
248   // Statics:
249 public:
250   // Required by the CMICmdFactory when registering *this command
251   static CMICmdBase *CreateSelf();
252 
253   // Methods:
254 public:
255   /* ctor */ CMICmdCmdExecInterrupt();
256 
257   // Overridden:
258 public:
259   // From CMICmdInvoker::ICmd
260   bool Execute() override;
261   bool Acknowledge() override;
262   // From CMICmnBase
263   /* dtor */ ~CMICmdCmdExecInterrupt() override;
264 };
265 
266 //++
267 //============================================================================
268 // Details: MI command class. MI commands derived from the command base class.
269 //          *this class implements MI command "exec-arguments".
270 //--
271 class CMICmdCmdExecArguments : public CMICmdBase {
272   // Statics:
273 public:
274   // Required by the CMICmdFactory when registering *this command
275   static CMICmdBase *CreateSelf();
276 
277   // Methods:
278 public:
279   /* ctor */ CMICmdCmdExecArguments();
280 
281   // Overridden:
282 public:
283   // From CMICmdInvoker::ICmd
284   bool Execute() override;
285   bool Acknowledge() override;
286   bool ParseArgs() override;
287   // From CMICmnBase
288   /* dtor */ ~CMICmdCmdExecArguments() override;
289 
290   // Attributes:
291 private:
292   const CMIUtilString m_constStrArgArguments;
293 };
294 
295 //++
296 //============================================================================
297 // Details: MI command class. MI commands derived from the command base class.
298 //          *this class implements MI command "exec-abort".
299 //--
300 class CMICmdCmdExecAbort : public CMICmdBase {
301   // Statics:
302 public:
303   // Required by the CMICmdFactory when registering *this command
304   static CMICmdBase *CreateSelf();
305 
306   // Methods:
307 public:
308   /* ctor */ CMICmdCmdExecAbort();
309 
310   // Overridden:
311 public:
312   // From CMICmdInvoker::ICmd
313   bool Execute() override;
314   bool Acknowledge() override;
315   // From CMICmnBase
316   /* dtor */ ~CMICmdCmdExecAbort() override;
317 };
318