blob: df96b04c66add323fea45b6cd9cd6417fcfffa67 [file] [log] [blame]
Chris Lattner24943d22010-06-08 16:52:24 +00001//===-- 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"
Jim Ingham84cdc152010-06-15 19:49:27 +000023#include "lldb/Interpreter/Options.h"
Chris Lattner24943d22010-06-08 16:52:24 +000024#include "lldb/Core/STLUtils.h"
25
26namespace lldb_private {
27
28//-------------------------------------------------------------------------
29// CommandObjectMultiwordBreakpoint
30//-------------------------------------------------------------------------
31
32class CommandObjectMultiwordBreakpoint : public CommandObjectMultiword
33{
34public:
Greg Clayton63094e02010-06-23 01:19:29 +000035 CommandObjectMultiwordBreakpoint (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +000036
37 virtual
38 ~CommandObjectMultiwordBreakpoint ();
39
40 static void
41 VerifyBreakpointIDs (Args &args, Target *target, CommandReturnObject &result, BreakpointIDList *valid_ids);
42
43};
44
45//-------------------------------------------------------------------------
Johnny Chena62ad7c2010-10-28 17:27:46 +000046// CommandObjectdBreakpointSet
Chris Lattner24943d22010-06-08 16:52:24 +000047//-------------------------------------------------------------------------
48
49
50class CommandObjectBreakpointSet : public CommandObject
51{
52public:
53
54 typedef enum BreakpointSetType
55 {
56 eSetTypeInvalid,
57 eSetTypeFileAndLine,
58 eSetTypeAddress,
59 eSetTypeFunctionName,
Jim Ingham03c8ee52011-09-21 01:17:13 +000060 eSetTypeFunctionRegexp,
Jim Ingham4722b102012-03-06 00:37:27 +000061 eSetTypeSourceRegexp,
62 eSetTypeException
Chris Lattner24943d22010-06-08 16:52:24 +000063 } BreakpointSetType;
64
Greg Clayton238c0a12010-09-18 01:14:36 +000065 CommandObjectBreakpointSet (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +000066
67 virtual
68 ~CommandObjectBreakpointSet ();
69
70 virtual bool
Greg Clayton238c0a12010-09-18 01:14:36 +000071 Execute (Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +000072 CommandReturnObject &result);
73
74 virtual Options *
75 GetOptions ();
76
77 class CommandOptions : public Options
78 {
79 public:
80
Greg Claytonf15996e2011-04-07 22:46:35 +000081 CommandOptions (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +000082
83 virtual
84 ~CommandOptions ();
85
86 virtual Error
Greg Clayton143fcc32011-04-13 00:18:08 +000087 SetOptionValue (uint32_t option_idx, const char *option_arg);
Chris Lattner24943d22010-06-08 16:52:24 +000088
89 void
Greg Clayton143fcc32011-04-13 00:18:08 +000090 OptionParsingStarting ();
Chris Lattner24943d22010-06-08 16:52:24 +000091
Greg Claytonb3448432011-03-24 21:19:54 +000092 const OptionDefinition*
Chris Lattner24943d22010-06-08 16:52:24 +000093 GetDefinitions ();
94
95 // Options table: Required for subclasses of Options.
96
Greg Claytonb3448432011-03-24 21:19:54 +000097 static OptionDefinition g_option_table[];
Chris Lattner24943d22010-06-08 16:52:24 +000098
99 // Instance variables to hold the values for command options.
100
Jim Inghamd6d47972011-09-23 00:54:11 +0000101 FileSpecList m_filenames;
Greg Clayton12bec712010-06-28 21:30:43 +0000102 uint32_t m_line_num;
103 uint32_t m_column;
Greg Clayton2dfe4c62010-11-02 03:02:38 +0000104 bool m_check_inlines;
Jim Ingham4722b102012-03-06 00:37:27 +0000105 std::vector<std::string> m_func_names;
Greg Clayton12bec712010-06-28 21:30:43 +0000106 uint32_t m_func_name_type_mask;
Chris Lattner24943d22010-06-08 16:52:24 +0000107 std::string m_func_regexp;
Jim Ingham03c8ee52011-09-21 01:17:13 +0000108 std::string m_source_text_regexp;
Jim Inghamd6d47972011-09-23 00:54:11 +0000109 FileSpecList m_modules;
Greg Clayton54e7afa2010-07-09 20:39:50 +0000110 lldb::addr_t m_load_addr;
111 uint32_t m_ignore_count;
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000112 lldb::tid_t m_thread_id;
113 uint32_t m_thread_index;
114 std::string m_thread_name;
115 std::string m_queue_name;
Jim Ingham4722b102012-03-06 00:37:27 +0000116 bool m_catch_bp;
117 bool m_throw_bp;
118 lldb::LanguageType m_language;
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000119
120 };
121
122private:
Jim Ingham03c8ee52011-09-21 01:17:13 +0000123 bool
Jim Inghamd6d47972011-09-23 00:54:11 +0000124 GetDefaultFile (Target *target, FileSpec &file, CommandReturnObject &result);
Jim Ingham03c8ee52011-09-21 01:17:13 +0000125
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000126 CommandOptions m_options;
127};
128
129//-------------------------------------------------------------------------
Jim Ingham10622a22010-06-18 00:58:52 +0000130// CommandObjectMultiwordBreakpointModify
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000131//-------------------------------------------------------------------------
132
133
Jim Ingham10622a22010-06-18 00:58:52 +0000134class CommandObjectBreakpointModify : public CommandObject
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000135{
136public:
137
Greg Clayton238c0a12010-09-18 01:14:36 +0000138 CommandObjectBreakpointModify (CommandInterpreter &interpreter);
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000139
140 virtual
Jim Ingham10622a22010-06-18 00:58:52 +0000141 ~CommandObjectBreakpointModify ();
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000142
143 virtual bool
Greg Clayton238c0a12010-09-18 01:14:36 +0000144 Execute (Args& command,
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000145 CommandReturnObject &result);
146
147 virtual Options *
148 GetOptions ();
149
150 class CommandOptions : public Options
151 {
152 public:
153
Greg Claytonf15996e2011-04-07 22:46:35 +0000154 CommandOptions (CommandInterpreter &interpreter);
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000155
156 virtual
157 ~CommandOptions ();
158
159 virtual Error
Greg Clayton143fcc32011-04-13 00:18:08 +0000160 SetOptionValue (uint32_t option_idx, const char *option_arg);
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000161
162 void
Greg Clayton143fcc32011-04-13 00:18:08 +0000163 OptionParsingStarting ();
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000164
Greg Claytonb3448432011-03-24 21:19:54 +0000165 const OptionDefinition*
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000166 GetDefinitions ();
167
168 // Options table: Required for subclasses of Options.
169
Greg Claytonb3448432011-03-24 21:19:54 +0000170 static OptionDefinition g_option_table[];
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000171
172 // Instance variables to hold the values for command options.
173
Greg Clayton54e7afa2010-07-09 20:39:50 +0000174 uint32_t m_ignore_count;
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000175 lldb::tid_t m_thread_id;
Jim Ingham9a7b2912010-12-03 23:04:19 +0000176 bool m_thread_id_passed;
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000177 uint32_t m_thread_index;
Jim Ingham9a7b2912010-12-03 23:04:19 +0000178 bool m_thread_index_passed;
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000179 std::string m_thread_name;
180 std::string m_queue_name;
Jim Inghamd1686902010-10-14 23:45:03 +0000181 std::string m_condition;
Jim Ingham10622a22010-06-18 00:58:52 +0000182 bool m_enable_passed;
183 bool m_enable_value;
Jim Inghamd4571222010-06-19 04:35:20 +0000184 bool m_name_passed;
185 bool m_queue_passed;
Jim Inghamd1686902010-10-14 23:45:03 +0000186 bool m_condition_passed;
Chris Lattner24943d22010-06-08 16:52:24 +0000187
188 };
189
190private:
191 CommandOptions m_options;
192};
193
194//-------------------------------------------------------------------------
195// CommandObjectBreakpointEnable
196//-------------------------------------------------------------------------
197
198class CommandObjectBreakpointEnable : public CommandObject
199{
200public:
Greg Clayton238c0a12010-09-18 01:14:36 +0000201 CommandObjectBreakpointEnable (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +0000202
203 virtual
204 ~CommandObjectBreakpointEnable ();
205
206 virtual bool
Greg Clayton238c0a12010-09-18 01:14:36 +0000207 Execute (Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +0000208 CommandReturnObject &result);
209
210private:
211};
212
213//-------------------------------------------------------------------------
214// CommandObjectBreakpointDisable
215//-------------------------------------------------------------------------
216
217class CommandObjectBreakpointDisable : public CommandObject
218{
219public:
Greg Clayton238c0a12010-09-18 01:14:36 +0000220 CommandObjectBreakpointDisable (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +0000221
222 virtual
223 ~CommandObjectBreakpointDisable ();
224
225 virtual bool
Greg Clayton238c0a12010-09-18 01:14:36 +0000226 Execute (Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +0000227 CommandReturnObject &result);
228
229private:
230};
231
232//-------------------------------------------------------------------------
233// CommandObjectBreakpointList
234//-------------------------------------------------------------------------
235
236class CommandObjectBreakpointList : public CommandObject
237{
238public:
Greg Clayton238c0a12010-09-18 01:14:36 +0000239 CommandObjectBreakpointList (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +0000240
241 virtual
242 ~CommandObjectBreakpointList ();
243
244 virtual bool
Greg Clayton238c0a12010-09-18 01:14:36 +0000245 Execute (Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +0000246 CommandReturnObject &result);
247
248 virtual Options *
249 GetOptions ();
250
251 class CommandOptions : public Options
252 {
253 public:
254
Greg Claytonf15996e2011-04-07 22:46:35 +0000255 CommandOptions (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +0000256
257 virtual
258 ~CommandOptions ();
259
260 virtual Error
Greg Clayton143fcc32011-04-13 00:18:08 +0000261 SetOptionValue (uint32_t option_idx, const char *option_arg);
Chris Lattner24943d22010-06-08 16:52:24 +0000262
263 void
Greg Clayton143fcc32011-04-13 00:18:08 +0000264 OptionParsingStarting ();
Chris Lattner24943d22010-06-08 16:52:24 +0000265
Greg Claytonb3448432011-03-24 21:19:54 +0000266 const OptionDefinition *
Chris Lattner24943d22010-06-08 16:52:24 +0000267 GetDefinitions ();
268
269 // Options table: Required for subclasses of Options.
270
Greg Claytonb3448432011-03-24 21:19:54 +0000271 static OptionDefinition g_option_table[];
Chris Lattner24943d22010-06-08 16:52:24 +0000272
273 // Instance variables to hold the values for command options.
274
275 lldb::DescriptionLevel m_level;
276
277 bool m_internal;
278 };
279
280private:
281 CommandOptions m_options;
282};
283
284//-------------------------------------------------------------------------
Johnny Chena62ad7c2010-10-28 17:27:46 +0000285// CommandObjectBreakpointClear
286//-------------------------------------------------------------------------
287
288
289class CommandObjectBreakpointClear : public CommandObject
290{
291public:
292
293 typedef enum BreakpointClearType
294 {
295 eClearTypeInvalid,
Greg Clayton17f5afe2011-02-05 02:56:16 +0000296 eClearTypeFileAndLine
Johnny Chena62ad7c2010-10-28 17:27:46 +0000297 } BreakpointClearType;
298
299 CommandObjectBreakpointClear (CommandInterpreter &interpreter);
300
301 virtual
302 ~CommandObjectBreakpointClear ();
303
304 virtual bool
305 Execute (Args& command,
306 CommandReturnObject &result);
307
308 virtual Options *
309 GetOptions ();
310
311 class CommandOptions : public Options
312 {
313 public:
314
Greg Claytonf15996e2011-04-07 22:46:35 +0000315 CommandOptions (CommandInterpreter &interpreter);
Johnny Chena62ad7c2010-10-28 17:27:46 +0000316
317 virtual
318 ~CommandOptions ();
319
320 virtual Error
Greg Clayton143fcc32011-04-13 00:18:08 +0000321 SetOptionValue (uint32_t option_idx, const char *option_arg);
Johnny Chena62ad7c2010-10-28 17:27:46 +0000322
323 void
Greg Clayton143fcc32011-04-13 00:18:08 +0000324 OptionParsingStarting ();
Johnny Chena62ad7c2010-10-28 17:27:46 +0000325
Greg Claytonb3448432011-03-24 21:19:54 +0000326 const OptionDefinition*
Johnny Chena62ad7c2010-10-28 17:27:46 +0000327 GetDefinitions ();
328
329 // Options table: Required for subclasses of Options.
330
Greg Claytonb3448432011-03-24 21:19:54 +0000331 static OptionDefinition g_option_table[];
Johnny Chena62ad7c2010-10-28 17:27:46 +0000332
333 // Instance variables to hold the values for command options.
334
335 std::string m_filename;
336 uint32_t m_line_num;
337
338 };
339
340private:
341 CommandOptions m_options;
342};
343
344//-------------------------------------------------------------------------
Chris Lattner24943d22010-06-08 16:52:24 +0000345// CommandObjectBreakpointDelete
346//-------------------------------------------------------------------------
347
348class CommandObjectBreakpointDelete : public CommandObject
349{
350public:
Greg Clayton238c0a12010-09-18 01:14:36 +0000351 CommandObjectBreakpointDelete (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +0000352
353 virtual
354 ~CommandObjectBreakpointDelete ();
355
356 virtual bool
Greg Clayton238c0a12010-09-18 01:14:36 +0000357 Execute (Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +0000358 CommandReturnObject &result);
359
360private:
361};
362
363} // namespace lldb_private
364
365#endif // liblldb_CommandObjectBreakpoint_h_