blob: c624dc554e2d24beb2b16ceed6cd5b19b2f3bc93 [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,
Eli Friedmanb4a47282010-06-09 07:57:51 +000060 eSetTypeFunctionRegexp
Chris Lattner24943d22010-06-08 16:52:24 +000061 } BreakpointSetType;
62
Greg Clayton238c0a12010-09-18 01:14:36 +000063 CommandObjectBreakpointSet (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +000064
65 virtual
66 ~CommandObjectBreakpointSet ();
67
68 virtual bool
Greg Clayton238c0a12010-09-18 01:14:36 +000069 Execute (Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +000070 CommandReturnObject &result);
71
72 virtual Options *
73 GetOptions ();
74
75 class CommandOptions : public Options
76 {
77 public:
78
Greg Claytonf15996e2011-04-07 22:46:35 +000079 CommandOptions (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +000080
81 virtual
82 ~CommandOptions ();
83
84 virtual Error
85 SetOptionValue (int option_idx, const char *option_arg);
86
87 void
88 ResetOptionValues ();
89
Greg Claytonb3448432011-03-24 21:19:54 +000090 const OptionDefinition*
Chris Lattner24943d22010-06-08 16:52:24 +000091 GetDefinitions ();
92
93 // Options table: Required for subclasses of Options.
94
Greg Claytonb3448432011-03-24 21:19:54 +000095 static OptionDefinition g_option_table[];
Chris Lattner24943d22010-06-08 16:52:24 +000096
97 // Instance variables to hold the values for command options.
98
99 std::string m_filename;
Greg Clayton12bec712010-06-28 21:30:43 +0000100 uint32_t m_line_num;
101 uint32_t m_column;
Greg Clayton2dfe4c62010-11-02 03:02:38 +0000102 bool m_check_inlines;
Chris Lattner24943d22010-06-08 16:52:24 +0000103 std::string m_func_name;
Greg Clayton12bec712010-06-28 21:30:43 +0000104 uint32_t m_func_name_type_mask;
Chris Lattner24943d22010-06-08 16:52:24 +0000105 std::string m_func_regexp;
Chris Lattner24943d22010-06-08 16:52:24 +0000106 STLStringArray m_modules;
Greg Clayton54e7afa2010-07-09 20:39:50 +0000107 lldb::addr_t m_load_addr;
108 uint32_t m_ignore_count;
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000109 lldb::tid_t m_thread_id;
110 uint32_t m_thread_index;
111 std::string m_thread_name;
112 std::string m_queue_name;
113
114 };
115
116private:
117 CommandOptions m_options;
118};
119
120//-------------------------------------------------------------------------
Jim Ingham10622a22010-06-18 00:58:52 +0000121// CommandObjectMultiwordBreakpointModify
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000122//-------------------------------------------------------------------------
123
124
Jim Ingham10622a22010-06-18 00:58:52 +0000125class CommandObjectBreakpointModify : public CommandObject
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000126{
127public:
128
Greg Clayton238c0a12010-09-18 01:14:36 +0000129 CommandObjectBreakpointModify (CommandInterpreter &interpreter);
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000130
131 virtual
Jim Ingham10622a22010-06-18 00:58:52 +0000132 ~CommandObjectBreakpointModify ();
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000133
134 virtual bool
Greg Clayton238c0a12010-09-18 01:14:36 +0000135 Execute (Args& command,
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000136 CommandReturnObject &result);
137
138 virtual Options *
139 GetOptions ();
140
141 class CommandOptions : public Options
142 {
143 public:
144
Greg Claytonf15996e2011-04-07 22:46:35 +0000145 CommandOptions (CommandInterpreter &interpreter);
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000146
147 virtual
148 ~CommandOptions ();
149
150 virtual Error
151 SetOptionValue (int option_idx, const char *option_arg);
152
153 void
154 ResetOptionValues ();
155
Greg Claytonb3448432011-03-24 21:19:54 +0000156 const OptionDefinition*
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000157 GetDefinitions ();
158
159 // Options table: Required for subclasses of Options.
160
Greg Claytonb3448432011-03-24 21:19:54 +0000161 static OptionDefinition g_option_table[];
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000162
163 // Instance variables to hold the values for command options.
164
Greg Clayton54e7afa2010-07-09 20:39:50 +0000165 uint32_t m_ignore_count;
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000166 lldb::tid_t m_thread_id;
Jim Ingham9a7b2912010-12-03 23:04:19 +0000167 bool m_thread_id_passed;
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000168 uint32_t m_thread_index;
Jim Ingham9a7b2912010-12-03 23:04:19 +0000169 bool m_thread_index_passed;
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000170 std::string m_thread_name;
171 std::string m_queue_name;
Jim Inghamd1686902010-10-14 23:45:03 +0000172 std::string m_condition;
Jim Ingham10622a22010-06-18 00:58:52 +0000173 bool m_enable_passed;
174 bool m_enable_value;
Jim Inghamd4571222010-06-19 04:35:20 +0000175 bool m_name_passed;
176 bool m_queue_passed;
Jim Inghamd1686902010-10-14 23:45:03 +0000177 bool m_condition_passed;
Chris Lattner24943d22010-06-08 16:52:24 +0000178
179 };
180
181private:
182 CommandOptions m_options;
183};
184
185//-------------------------------------------------------------------------
186// CommandObjectBreakpointEnable
187//-------------------------------------------------------------------------
188
189class CommandObjectBreakpointEnable : public CommandObject
190{
191public:
Greg Clayton238c0a12010-09-18 01:14:36 +0000192 CommandObjectBreakpointEnable (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +0000193
194 virtual
195 ~CommandObjectBreakpointEnable ();
196
197 virtual bool
Greg Clayton238c0a12010-09-18 01:14:36 +0000198 Execute (Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +0000199 CommandReturnObject &result);
200
201private:
202};
203
204//-------------------------------------------------------------------------
205// CommandObjectBreakpointDisable
206//-------------------------------------------------------------------------
207
208class CommandObjectBreakpointDisable : public CommandObject
209{
210public:
Greg Clayton238c0a12010-09-18 01:14:36 +0000211 CommandObjectBreakpointDisable (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +0000212
213 virtual
214 ~CommandObjectBreakpointDisable ();
215
216 virtual bool
Greg Clayton238c0a12010-09-18 01:14:36 +0000217 Execute (Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +0000218 CommandReturnObject &result);
219
220private:
221};
222
223//-------------------------------------------------------------------------
224// CommandObjectBreakpointList
225//-------------------------------------------------------------------------
226
227class CommandObjectBreakpointList : public CommandObject
228{
229public:
Greg Clayton238c0a12010-09-18 01:14:36 +0000230 CommandObjectBreakpointList (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +0000231
232 virtual
233 ~CommandObjectBreakpointList ();
234
235 virtual bool
Greg Clayton238c0a12010-09-18 01:14:36 +0000236 Execute (Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +0000237 CommandReturnObject &result);
238
239 virtual Options *
240 GetOptions ();
241
242 class CommandOptions : public Options
243 {
244 public:
245
Greg Claytonf15996e2011-04-07 22:46:35 +0000246 CommandOptions (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +0000247
248 virtual
249 ~CommandOptions ();
250
251 virtual Error
252 SetOptionValue (int option_idx, const char *option_arg);
253
254 void
255 ResetOptionValues ();
256
Greg Claytonb3448432011-03-24 21:19:54 +0000257 const OptionDefinition *
Chris Lattner24943d22010-06-08 16:52:24 +0000258 GetDefinitions ();
259
260 // Options table: Required for subclasses of Options.
261
Greg Claytonb3448432011-03-24 21:19:54 +0000262 static OptionDefinition g_option_table[];
Chris Lattner24943d22010-06-08 16:52:24 +0000263
264 // Instance variables to hold the values for command options.
265
266 lldb::DescriptionLevel m_level;
267
268 bool m_internal;
269 };
270
271private:
272 CommandOptions m_options;
273};
274
275//-------------------------------------------------------------------------
Johnny Chena62ad7c2010-10-28 17:27:46 +0000276// CommandObjectBreakpointClear
277//-------------------------------------------------------------------------
278
279
280class CommandObjectBreakpointClear : public CommandObject
281{
282public:
283
284 typedef enum BreakpointClearType
285 {
286 eClearTypeInvalid,
Greg Clayton17f5afe2011-02-05 02:56:16 +0000287 eClearTypeFileAndLine
Johnny Chena62ad7c2010-10-28 17:27:46 +0000288 } BreakpointClearType;
289
290 CommandObjectBreakpointClear (CommandInterpreter &interpreter);
291
292 virtual
293 ~CommandObjectBreakpointClear ();
294
295 virtual bool
296 Execute (Args& command,
297 CommandReturnObject &result);
298
299 virtual Options *
300 GetOptions ();
301
302 class CommandOptions : public Options
303 {
304 public:
305
Greg Claytonf15996e2011-04-07 22:46:35 +0000306 CommandOptions (CommandInterpreter &interpreter);
Johnny Chena62ad7c2010-10-28 17:27:46 +0000307
308 virtual
309 ~CommandOptions ();
310
311 virtual Error
312 SetOptionValue (int option_idx, const char *option_arg);
313
314 void
315 ResetOptionValues ();
316
Greg Claytonb3448432011-03-24 21:19:54 +0000317 const OptionDefinition*
Johnny Chena62ad7c2010-10-28 17:27:46 +0000318 GetDefinitions ();
319
320 // Options table: Required for subclasses of Options.
321
Greg Claytonb3448432011-03-24 21:19:54 +0000322 static OptionDefinition g_option_table[];
Johnny Chena62ad7c2010-10-28 17:27:46 +0000323
324 // Instance variables to hold the values for command options.
325
326 std::string m_filename;
327 uint32_t m_line_num;
328
329 };
330
331private:
332 CommandOptions m_options;
333};
334
335//-------------------------------------------------------------------------
Chris Lattner24943d22010-06-08 16:52:24 +0000336// CommandObjectBreakpointDelete
337//-------------------------------------------------------------------------
338
339class CommandObjectBreakpointDelete : public CommandObject
340{
341public:
Greg Clayton238c0a12010-09-18 01:14:36 +0000342 CommandObjectBreakpointDelete (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +0000343
344 virtual
345 ~CommandObjectBreakpointDelete ();
346
347 virtual bool
Greg Clayton238c0a12010-09-18 01:14:36 +0000348 Execute (Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +0000349 CommandReturnObject &result);
350
351private:
352};
353
354} // namespace lldb_private
355
356#endif // liblldb_CommandObjectBreakpoint_h_