1 //===-- CommandObjectBreakpoint.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 #ifndef liblldb_CommandObjectBreakpoint_h_
11 #define liblldb_CommandObjectBreakpoint_h_
12 
13 // C Includes
14 // C++ Includes
15 
16 #include <utility>
17 #include <vector>
18 
19 // Other libraries and framework includes
20 // Project includes
21 #include "lldb/Core/Address.h"
22 #include "lldb/Interpreter/CommandObjectMultiword.h"
23 #include "lldb/Interpreter/Options.h"
24 #include "lldb/Core/STLUtils.h"
25 
26 namespace lldb_private {
27 
28 //-------------------------------------------------------------------------
29 // CommandObjectMultiwordBreakpoint
30 //-------------------------------------------------------------------------
31 
32 class CommandObjectMultiwordBreakpoint : public CommandObjectMultiword
33 {
34 public:
35     CommandObjectMultiwordBreakpoint (CommandInterpreter &interpreter);
36 
37     virtual
38     ~CommandObjectMultiwordBreakpoint ();
39 
40     static void
41     VerifyBreakpointIDs (Args &args, Target *target, CommandReturnObject &result, BreakpointIDList *valid_ids);
42 
43 };
44 
45 //-------------------------------------------------------------------------
46 // CommandObjectdBreakpointSet
47 //-------------------------------------------------------------------------
48 
49 
50 class CommandObjectBreakpointSet : public CommandObject
51 {
52 public:
53 
54     typedef enum BreakpointSetType
55     {
56         eSetTypeInvalid,
57         eSetTypeFileAndLine,
58         eSetTypeAddress,
59         eSetTypeFunctionName,
60         eSetTypeFunctionRegexp,
61         eSetTypeSourceRegexp
62     } BreakpointSetType;
63 
64     CommandObjectBreakpointSet (CommandInterpreter &interpreter);
65 
66     virtual
67     ~CommandObjectBreakpointSet ();
68 
69     virtual bool
70     Execute (Args& command,
71              CommandReturnObject &result);
72 
73     virtual Options *
74     GetOptions ();
75 
76     class CommandOptions : public Options
77     {
78     public:
79 
80         CommandOptions (CommandInterpreter &interpreter);
81 
82         virtual
83         ~CommandOptions ();
84 
85         virtual Error
86         SetOptionValue (uint32_t option_idx, const char *option_arg);
87 
88         void
89         OptionParsingStarting ();
90 
91         const OptionDefinition*
92         GetDefinitions ();
93 
94         // Options table: Required for subclasses of Options.
95 
96         static OptionDefinition g_option_table[];
97 
98         // Instance variables to hold the values for command options.
99 
100         FileSpecList m_filenames;
101         uint32_t m_line_num;
102         uint32_t m_column;
103         bool m_check_inlines;
104         std::string m_func_name;
105         uint32_t m_func_name_type_mask;
106         std::string m_func_regexp;
107         std::string m_source_text_regexp;
108         FileSpecList m_modules;
109         lldb::addr_t m_load_addr;
110         uint32_t m_ignore_count;
111         lldb::tid_t m_thread_id;
112         uint32_t m_thread_index;
113         std::string m_thread_name;
114         std::string m_queue_name;
115 
116     };
117 
118 private:
119     bool
120     GetDefaultFile (Target *target, FileSpec &file, CommandReturnObject &result);
121 
122     CommandOptions m_options;
123 };
124 
125 //-------------------------------------------------------------------------
126 // CommandObjectMultiwordBreakpointModify
127 //-------------------------------------------------------------------------
128 
129 
130 class CommandObjectBreakpointModify : public CommandObject
131 {
132 public:
133 
134     CommandObjectBreakpointModify (CommandInterpreter &interpreter);
135 
136     virtual
137     ~CommandObjectBreakpointModify ();
138 
139     virtual bool
140     Execute (Args& command,
141              CommandReturnObject &result);
142 
143     virtual Options *
144     GetOptions ();
145 
146     class CommandOptions : public Options
147     {
148     public:
149 
150         CommandOptions (CommandInterpreter &interpreter);
151 
152         virtual
153         ~CommandOptions ();
154 
155         virtual Error
156         SetOptionValue (uint32_t option_idx, const char *option_arg);
157 
158         void
159         OptionParsingStarting ();
160 
161         const OptionDefinition*
162         GetDefinitions ();
163 
164         // Options table: Required for subclasses of Options.
165 
166         static OptionDefinition g_option_table[];
167 
168         // Instance variables to hold the values for command options.
169 
170         uint32_t m_ignore_count;
171         lldb::tid_t m_thread_id;
172         bool m_thread_id_passed;
173         uint32_t m_thread_index;
174         bool m_thread_index_passed;
175         std::string m_thread_name;
176         std::string m_queue_name;
177         std::string m_condition;
178         bool m_enable_passed;
179         bool m_enable_value;
180         bool m_name_passed;
181         bool m_queue_passed;
182         bool m_condition_passed;
183 
184     };
185 
186 private:
187     CommandOptions m_options;
188 };
189 
190 //-------------------------------------------------------------------------
191 // CommandObjectBreakpointEnable
192 //-------------------------------------------------------------------------
193 
194 class CommandObjectBreakpointEnable : public CommandObject
195 {
196 public:
197     CommandObjectBreakpointEnable (CommandInterpreter &interpreter);
198 
199     virtual
200     ~CommandObjectBreakpointEnable ();
201 
202     virtual bool
203     Execute (Args& command,
204              CommandReturnObject &result);
205 
206 private:
207 };
208 
209 //-------------------------------------------------------------------------
210 // CommandObjectBreakpointDisable
211 //-------------------------------------------------------------------------
212 
213 class CommandObjectBreakpointDisable : public CommandObject
214 {
215 public:
216     CommandObjectBreakpointDisable (CommandInterpreter &interpreter);
217 
218     virtual
219     ~CommandObjectBreakpointDisable ();
220 
221     virtual bool
222     Execute (Args& command,
223              CommandReturnObject &result);
224 
225 private:
226 };
227 
228 //-------------------------------------------------------------------------
229 // CommandObjectBreakpointList
230 //-------------------------------------------------------------------------
231 
232 class CommandObjectBreakpointList : public CommandObject
233 {
234 public:
235     CommandObjectBreakpointList (CommandInterpreter &interpreter);
236 
237     virtual
238     ~CommandObjectBreakpointList ();
239 
240     virtual bool
241     Execute (Args& command,
242              CommandReturnObject &result);
243 
244     virtual Options *
245     GetOptions ();
246 
247     class CommandOptions : public Options
248     {
249     public:
250 
251         CommandOptions (CommandInterpreter &interpreter);
252 
253         virtual
254         ~CommandOptions ();
255 
256         virtual Error
257         SetOptionValue (uint32_t option_idx, const char *option_arg);
258 
259         void
260         OptionParsingStarting ();
261 
262         const OptionDefinition *
263         GetDefinitions ();
264 
265         // Options table: Required for subclasses of Options.
266 
267         static OptionDefinition g_option_table[];
268 
269         // Instance variables to hold the values for command options.
270 
271         lldb::DescriptionLevel m_level;
272 
273         bool m_internal;
274     };
275 
276 private:
277     CommandOptions m_options;
278 };
279 
280 //-------------------------------------------------------------------------
281 // CommandObjectBreakpointClear
282 //-------------------------------------------------------------------------
283 
284 
285 class CommandObjectBreakpointClear : public CommandObject
286 {
287 public:
288 
289     typedef enum BreakpointClearType
290     {
291         eClearTypeInvalid,
292         eClearTypeFileAndLine
293     } BreakpointClearType;
294 
295     CommandObjectBreakpointClear (CommandInterpreter &interpreter);
296 
297     virtual
298     ~CommandObjectBreakpointClear ();
299 
300     virtual bool
301     Execute (Args& command,
302              CommandReturnObject &result);
303 
304     virtual Options *
305     GetOptions ();
306 
307     class CommandOptions : public Options
308     {
309     public:
310 
311         CommandOptions (CommandInterpreter &interpreter);
312 
313         virtual
314         ~CommandOptions ();
315 
316         virtual Error
317         SetOptionValue (uint32_t option_idx, const char *option_arg);
318 
319         void
320         OptionParsingStarting ();
321 
322         const OptionDefinition*
323         GetDefinitions ();
324 
325         // Options table: Required for subclasses of Options.
326 
327         static OptionDefinition g_option_table[];
328 
329         // Instance variables to hold the values for command options.
330 
331         std::string m_filename;
332         uint32_t m_line_num;
333 
334     };
335 
336 private:
337     CommandOptions m_options;
338 };
339 
340 //-------------------------------------------------------------------------
341 // CommandObjectBreakpointDelete
342 //-------------------------------------------------------------------------
343 
344 class CommandObjectBreakpointDelete : public CommandObject
345 {
346 public:
347     CommandObjectBreakpointDelete (CommandInterpreter &interpreter);
348 
349     virtual
350     ~CommandObjectBreakpointDelete ();
351 
352     virtual bool
353     Execute (Args& command,
354              CommandReturnObject &result);
355 
356 private:
357 };
358 
359 } // namespace lldb_private
360 
361 #endif  // liblldb_CommandObjectBreakpoint_h_
362