]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/tools/lldb-mi/MICmdCmdBreak.h
Merge ^/head r274961 through r276342.
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / tools / lldb-mi / MICmdCmdBreak.h
1 //===-- MICmdCmdBreak.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 //++
11 // File:                MICmdCmdBreak.h
12 //
13 // Overview:    CMICmdCmdBreakInsert                    interface.
14 //                              CMICmdCmdBreakDelete                    interface.
15 //                              CMICmdCmdBreakDisable                   interface.
16 //                              CMICmdCmdBreakEnable                    interface.
17 //                              CMICmdCmdBreakAfter                             interface.
18 //                              CMICmdCmdBreakCondition                 interface.
19 //
20 //                              To implement new MI commands derive a new command class from the command base 
21 //                              class. To enable the new command for interpretation add the new command class
22 //                              to the command factory. The files of relevance are:
23 //                                      MICmdCommands.cpp
24 //                                      MICmdBase.h / .cpp
25 //                                      MICmdCmd.h / .cpp
26 //                              For an introduction to adding a new command see CMICmdCmdSupportInfoMiCmdQuery
27 //                              command class as an example.
28 //
29 // Environment: Compilers:      Visual C++ 12.
30 //                                                      gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
31 //                              Libraries:      See MIReadmetxt. 
32 //
33 // Copyright:   None.
34 //--
35
36 #pragma once
37
38 // Third party headers:
39 #include <lldb/API/SBBreakpoint.h>
40
41 // In-house headers:
42 #include "MICmdBase.h"
43
44 //++ ============================================================================
45 // Details:     MI command class. MI commands derived from the command base class.
46 //                      *this class implements MI command "break-insert".
47 //                      This command does not follow the MI documentation exactly.
48 // Gotchas:     None.
49 // Authors:     Illya Rudkin 11/03/2014.
50 // Changes:     None.
51 //--
52 class CMICmdCmdBreakInsert : public CMICmdBase
53 {
54 // Statics:
55 public:
56         // Required by the CMICmdFactory when registering *this command
57         static CMICmdBase *     CreateSelf( void );
58
59 // Methods:
60 public:
61         /* ctor */      CMICmdCmdBreakInsert( void );
62
63 // Overridden:
64 public:
65         // From CMICmdInvoker::ICmd
66         virtual bool    Execute( void );
67         virtual bool    Acknowledge( void );
68         virtual bool    ParseArgs( void );
69         // From CMICmnBase
70         /* dtor */ virtual ~CMICmdCmdBreakInsert( void );
71
72 // Enumerations:
73 private:
74         //++ ===================================================================
75         // Details:     The type of break point give in the MI command text.
76         //--
77         enum BreakPoint_e
78         {
79                 eBreakPoint_Invalid     = 0,
80                 eBreakPoint_ByFileLine,
81                 eBreakPoint_ByFileFn,
82                 eBreakPoint_ByName,
83                 eBreakPoint_ByAddress,
84                 eBreakPoint_count,
85                 eBreakPoint_NotDefineYet
86         };
87
88 // Attributes:
89 private:
90         bool                            m_bBrkPtIsTemp;
91         bool                            m_bHaveArgOptionThreadGrp;
92         CMIUtilString           m_brkName;
93         CMIUtilString           m_strArgOptionThreadGrp;
94         lldb::SBBreakpoint      m_brkPt;
95         bool                            m_bBrkPtIsPending;
96         MIuint                          m_nBrkPtIgnoreCount;
97         bool                            m_bBrkPtEnabled;
98         bool                            m_bBrkPtCondition;
99         CMIUtilString           m_brkPtCondition;
100         bool                            m_bBrkPtThreadId;
101         MIuint                          m_nBrkPtThreadId;
102         const CMIUtilString     m_constStrArgNamedTempBrkPt;
103         const CMIUtilString     m_constStrArgNamedHWBrkPt;                                      // Not handled by *this command
104         const CMIUtilString     m_constStrArgNamedPendinfBrkPt;                         
105         const CMIUtilString     m_constStrArgNamedDisableBrkPt;                         
106         const CMIUtilString     m_constStrArgNamedTracePt;                                      // Not handled by *this command
107         const CMIUtilString     m_constStrArgNamedConditionalBrkPt;                     
108         const CMIUtilString     m_constStrArgNamedInoreCnt;                                     
109         const CMIUtilString     m_constStrArgNamedRestrictBrkPtToThreadId;      
110         const CMIUtilString     m_constStrArgNamedLocation;
111         const CMIUtilString     m_constStrArgNamedThreadGroup;                          // Not specified in MI spec but Eclipse gives this option sometimes
112 };
113
114 //++ ============================================================================
115 // Details:     MI command class. MI commands derived from the command base class.
116 //                      *this class implements MI command "break-delete".
117 // Gotchas:     None.
118 // Authors:     Illya Rudkin 11/03/2014.
119 // Changes:     None.
120 //--
121 class CMICmdCmdBreakDelete : public CMICmdBase
122 {
123 // Statics:
124 public:
125         // Required by the CMICmdFactory when registering *this command
126         static CMICmdBase *     CreateSelf( void );
127
128 // Methods:
129 public:
130         /* ctor */      CMICmdCmdBreakDelete( void );
131
132 // Overridden:
133 public:
134         // From CMICmdInvoker::ICmd
135         virtual bool    Execute( void );
136         virtual bool    Acknowledge( void );
137         virtual bool    ParseArgs( void );
138         // From CMICmnBase
139         /* dtor */ virtual ~CMICmdCmdBreakDelete( void );
140
141 // Attributes:
142 private:
143         const CMIUtilString     m_constStrArgNamedBrkPt;
144         const CMIUtilString     m_constStrArgNamedThreadGrp;    // Not specified in MI spec but Eclipse gives this option
145 };
146
147 //++ ============================================================================
148 // Details:     MI command class. MI commands derived from the command base class.
149 //                      *this class implements MI command "break-disable".
150 // Gotchas:     None.
151 // Authors:     Illya Rudkin 19/05/2014.
152 // Changes:     None.
153 //--
154 class CMICmdCmdBreakDisable : public CMICmdBase
155 {
156 // Statics:
157 public:
158         // Required by the CMICmdFactory when registering *this command
159         static CMICmdBase *     CreateSelf( void );
160
161 // Methods:
162 public:
163         /* ctor */      CMICmdCmdBreakDisable( void );
164
165 // Overridden:
166 public:
167         // From CMICmdInvoker::ICmd
168         virtual bool    Execute( void );
169         virtual bool    Acknowledge( void );
170         virtual bool    ParseArgs( void );
171         // From CMICmnBase
172         /* dtor */ virtual ~CMICmdCmdBreakDisable( void );
173
174 // Attributes:
175 private:
176         const CMIUtilString     m_constStrArgNamedThreadGrp;    // Not specified in MI spec but Eclipse gives this option
177         const CMIUtilString     m_constStrArgNamedBrkPt;
178         bool                            m_bBrkPtDisabledOk;
179         MIuint                          m_nBrkPtId;
180 };
181
182 //++ ============================================================================
183 // Details:     MI command class. MI commands derived from the command base class.
184 //                      *this class implements MI command "break-enable".
185 // Gotchas:     None.
186 // Authors:     Illya Rudkin 19/05/2014.
187 // Changes:     None.
188 //--
189 class CMICmdCmdBreakEnable : public CMICmdBase
190 {
191 // Statics:
192 public:
193         // Required by the CMICmdFactory when registering *this command
194         static CMICmdBase *     CreateSelf( void );
195
196 // Methods:
197 public:
198         /* ctor */      CMICmdCmdBreakEnable( void );
199
200 // Overridden:
201 public:
202         // From CMICmdInvoker::ICmd
203         virtual bool    Execute( void );
204         virtual bool    Acknowledge( void );
205         virtual bool    ParseArgs( void );
206         // From CMICmnBase
207         /* dtor */ virtual ~CMICmdCmdBreakEnable( void );
208
209 // Attributes:
210 private:
211         const CMIUtilString     m_constStrArgNamedThreadGrp;    // Not specified in MI spec but Eclipse gives this option
212         const CMIUtilString     m_constStrArgNamedBrkPt;
213         bool                            m_bBrkPtEnabledOk;
214         MIuint                          m_nBrkPtId;
215 };
216
217 //++ ============================================================================
218 // Details:     MI command class. MI commands derived from the command base class.
219 //                      *this class implements MI command "break-after".
220 // Gotchas:     None.
221 // Authors:     Illya Rudkin 29/05/2014.
222 // Changes:     None.
223 //--
224 class CMICmdCmdBreakAfter : public CMICmdBase
225 {
226 // Statics:
227 public:
228         // Required by the CMICmdFactory when registering *this command
229         static CMICmdBase *     CreateSelf( void );
230
231 // Methods:
232 public:
233         /* ctor */      CMICmdCmdBreakAfter( void );
234
235 // Overridden:
236 public:
237         // From CMICmdInvoker::ICmd
238         virtual bool    Execute( void );
239         virtual bool    Acknowledge( void );
240         virtual bool    ParseArgs( void );
241         // From CMICmnBase
242         /* dtor */ virtual ~CMICmdCmdBreakAfter( void );
243
244 // Attributes:
245 private:
246         const CMIUtilString     m_constStrArgNamedThreadGrp;    // Not specified in MI spec but Eclipse gives this option
247         const CMIUtilString     m_constStrArgNamedNumber;
248         const CMIUtilString     m_constStrArgNamedCount;
249         MIuint                          m_nBrkPtId;
250         MIuint                          m_nBrkPtCount;
251 };
252
253 //++ ============================================================================
254 // Details:     MI command class. MI commands derived from the command base class.
255 //                      *this class implements MI command "break-condition".
256 // Gotchas:     None.
257 // Authors:     Illya Rudkin 29/05/2014.
258 // Changes:     None.
259 //--
260 class CMICmdCmdBreakCondition : public CMICmdBase
261 {
262 // Statics:
263 public:
264         // Required by the CMICmdFactory when registering *this command
265         static CMICmdBase *     CreateSelf( void );
266
267 // Methods:
268 public:
269         /* ctor */      CMICmdCmdBreakCondition( void );
270
271 // Overridden:
272 public:
273         // From CMICmdInvoker::ICmd
274         virtual bool    Execute( void );
275         virtual bool    Acknowledge( void );
276         virtual bool    ParseArgs( void );
277         // From CMICmnBase
278         /* dtor */ virtual ~CMICmdCmdBreakCondition( void );
279
280 // Methods:
281 private:
282         CMIUtilString GetRestOfExpressionNotSurroundedInQuotes( void );
283
284 // Attributes:
285 private:
286         const CMIUtilString     m_constStrArgNamedThreadGrp;    // Not specified in MI spec but Eclipse gives this option
287         const CMIUtilString     m_constStrArgNamedNumber;
288         const CMIUtilString     m_constStrArgNamedExpr;
289         const CMIUtilString     m_constStrArgNamedExprNoQuotes; // Not specified in MI spec, we need to handle expressions not surrounded by quotes
290         MIuint                          m_nBrkPtId;
291         CMIUtilString           m_strBrkPtExpr;
292 };