blob: 9df14dafad4d80445002b2961af35364b1eaea11 [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,
61 eSetTypeSourceRegexp
Chris Lattner24943d22010-06-08 16:52:24 +000062 } BreakpointSetType;
63
Greg Clayton238c0a12010-09-18 01:14:36 +000064 CommandObjectBreakpointSet (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +000065
66 virtual
67 ~CommandObjectBreakpointSet ();
68
69 virtual bool
Greg Clayton238c0a12010-09-18 01:14:36 +000070 Execute (Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +000071 CommandReturnObject &result);
72
73 virtual Options *
74 GetOptions ();
75
76 class CommandOptions : public Options
77 {
78 public:
79
Greg Claytonf15996e2011-04-07 22:46:35 +000080 CommandOptions (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +000081
82 virtual
83 ~CommandOptions ();
84
85 virtual Error
Greg Clayton143fcc32011-04-13 00:18:08 +000086 SetOptionValue (uint32_t option_idx, const char *option_arg);
Chris Lattner24943d22010-06-08 16:52:24 +000087
88 void
Greg Clayton143fcc32011-04-13 00:18:08 +000089 OptionParsingStarting ();
Chris Lattner24943d22010-06-08 16:52:24 +000090
Greg Claytonb3448432011-03-24 21:19:54 +000091 const OptionDefinition*
Chris Lattner24943d22010-06-08 16:52:24 +000092 GetDefinitions ();
93
94 // Options table: Required for subclasses of Options.
95
Greg Claytonb3448432011-03-24 21:19:54 +000096 static OptionDefinition g_option_table[];
Chris Lattner24943d22010-06-08 16:52:24 +000097
98 // Instance variables to hold the values for command options.
99
100 std::string m_filename;
Greg Clayton12bec712010-06-28 21:30:43 +0000101 uint32_t m_line_num;
102 uint32_t m_column;
Greg Clayton2dfe4c62010-11-02 03:02:38 +0000103 bool m_check_inlines;
Chris Lattner24943d22010-06-08 16:52:24 +0000104 std::string m_func_name;
Greg Clayton12bec712010-06-28 21:30:43 +0000105 uint32_t m_func_name_type_mask;
Chris Lattner24943d22010-06-08 16:52:24 +0000106 std::string m_func_regexp;
Jim Ingham03c8ee52011-09-21 01:17:13 +0000107 std::string m_source_text_regexp;
Chris Lattner24943d22010-06-08 16:52:24 +0000108 STLStringArray m_modules;
Greg Clayton54e7afa2010-07-09 20:39:50 +0000109 lldb::addr_t m_load_addr;
110 uint32_t m_ignore_count;
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000111 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
118private:
Jim Ingham03c8ee52011-09-21 01:17:13 +0000119 bool
120 ChooseFile (Target *target, FileSpec &file, CommandReturnObject &result);
121
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000122 CommandOptions m_options;
123};
124
125//-------------------------------------------------------------------------
Jim Ingham10622a22010-06-18 00:58:52 +0000126// CommandObjectMultiwordBreakpointModify
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000127//-------------------------------------------------------------------------
128
129
Jim Ingham10622a22010-06-18 00:58:52 +0000130class CommandObjectBreakpointModify : public CommandObject
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000131{
132public:
133
Greg Clayton238c0a12010-09-18 01:14:36 +0000134 CommandObjectBreakpointModify (CommandInterpreter &interpreter);
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000135
136 virtual
Jim Ingham10622a22010-06-18 00:58:52 +0000137 ~CommandObjectBreakpointModify ();
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000138
139 virtual bool
Greg Clayton238c0a12010-09-18 01:14:36 +0000140 Execute (Args& command,
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000141 CommandReturnObject &result);
142
143 virtual Options *
144 GetOptions ();
145
146 class CommandOptions : public Options
147 {
148 public:
149
Greg Claytonf15996e2011-04-07 22:46:35 +0000150 CommandOptions (CommandInterpreter &interpreter);
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000151
152 virtual
153 ~CommandOptions ();
154
155 virtual Error
Greg Clayton143fcc32011-04-13 00:18:08 +0000156 SetOptionValue (uint32_t option_idx, const char *option_arg);
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000157
158 void
Greg Clayton143fcc32011-04-13 00:18:08 +0000159 OptionParsingStarting ();
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000160
Greg Claytonb3448432011-03-24 21:19:54 +0000161 const OptionDefinition*
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000162 GetDefinitions ();
163
164 // Options table: Required for subclasses of Options.
165
Greg Claytonb3448432011-03-24 21:19:54 +0000166 static OptionDefinition g_option_table[];
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000167
168 // Instance variables to hold the values for command options.
169
Greg Clayton54e7afa2010-07-09 20:39:50 +0000170 uint32_t m_ignore_count;
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000171 lldb::tid_t m_thread_id;
Jim Ingham9a7b2912010-12-03 23:04:19 +0000172 bool m_thread_id_passed;
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000173 uint32_t m_thread_index;
Jim Ingham9a7b2912010-12-03 23:04:19 +0000174 bool m_thread_index_passed;
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000175 std::string m_thread_name;
176 std::string m_queue_name;
Jim Inghamd1686902010-10-14 23:45:03 +0000177 std::string m_condition;
Jim Ingham10622a22010-06-18 00:58:52 +0000178 bool m_enable_passed;
179 bool m_enable_value;
Jim Inghamd4571222010-06-19 04:35:20 +0000180 bool m_name_passed;
181 bool m_queue_passed;
Jim Inghamd1686902010-10-14 23:45:03 +0000182 bool m_condition_passed;
Chris Lattner24943d22010-06-08 16:52:24 +0000183
184 };
185
186private:
187 CommandOptions m_options;
188};
189
190//-------------------------------------------------------------------------
191// CommandObjectBreakpointEnable
192//-------------------------------------------------------------------------
193
194class CommandObjectBreakpointEnable : public CommandObject
195{
196public:
Greg Clayton238c0a12010-09-18 01:14:36 +0000197 CommandObjectBreakpointEnable (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +0000198
199 virtual
200 ~CommandObjectBreakpointEnable ();
201
202 virtual bool
Greg Clayton238c0a12010-09-18 01:14:36 +0000203 Execute (Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +0000204 CommandReturnObject &result);
205
206private:
207};
208
209//-------------------------------------------------------------------------
210// CommandObjectBreakpointDisable
211//-------------------------------------------------------------------------
212
213class CommandObjectBreakpointDisable : public CommandObject
214{
215public:
Greg Clayton238c0a12010-09-18 01:14:36 +0000216 CommandObjectBreakpointDisable (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +0000217
218 virtual
219 ~CommandObjectBreakpointDisable ();
220
221 virtual bool
Greg Clayton238c0a12010-09-18 01:14:36 +0000222 Execute (Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +0000223 CommandReturnObject &result);
224
225private:
226};
227
228//-------------------------------------------------------------------------
229// CommandObjectBreakpointList
230//-------------------------------------------------------------------------
231
232class CommandObjectBreakpointList : public CommandObject
233{
234public:
Greg Clayton238c0a12010-09-18 01:14:36 +0000235 CommandObjectBreakpointList (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +0000236
237 virtual
238 ~CommandObjectBreakpointList ();
239
240 virtual bool
Greg Clayton238c0a12010-09-18 01:14:36 +0000241 Execute (Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +0000242 CommandReturnObject &result);
243
244 virtual Options *
245 GetOptions ();
246
247 class CommandOptions : public Options
248 {
249 public:
250
Greg Claytonf15996e2011-04-07 22:46:35 +0000251 CommandOptions (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +0000252
253 virtual
254 ~CommandOptions ();
255
256 virtual Error
Greg Clayton143fcc32011-04-13 00:18:08 +0000257 SetOptionValue (uint32_t option_idx, const char *option_arg);
Chris Lattner24943d22010-06-08 16:52:24 +0000258
259 void
Greg Clayton143fcc32011-04-13 00:18:08 +0000260 OptionParsingStarting ();
Chris Lattner24943d22010-06-08 16:52:24 +0000261
Greg Claytonb3448432011-03-24 21:19:54 +0000262 const OptionDefinition *
Chris Lattner24943d22010-06-08 16:52:24 +0000263 GetDefinitions ();
264
265 // Options table: Required for subclasses of Options.
266
Greg Claytonb3448432011-03-24 21:19:54 +0000267 static OptionDefinition g_option_table[];
Chris Lattner24943d22010-06-08 16:52:24 +0000268
269 // Instance variables to hold the values for command options.
270
271 lldb::DescriptionLevel m_level;
272
273 bool m_internal;
274 };
275
276private:
277 CommandOptions m_options;
278};
279
280//-------------------------------------------------------------------------
Johnny Chena62ad7c2010-10-28 17:27:46 +0000281// CommandObjectBreakpointClear
282//-------------------------------------------------------------------------
283
284
285class CommandObjectBreakpointClear : public CommandObject
286{
287public:
288
289 typedef enum BreakpointClearType
290 {
291 eClearTypeInvalid,
Greg Clayton17f5afe2011-02-05 02:56:16 +0000292 eClearTypeFileAndLine
Johnny Chena62ad7c2010-10-28 17:27:46 +0000293 } 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
Greg Claytonf15996e2011-04-07 22:46:35 +0000311 CommandOptions (CommandInterpreter &interpreter);
Johnny Chena62ad7c2010-10-28 17:27:46 +0000312
313 virtual
314 ~CommandOptions ();
315
316 virtual Error
Greg Clayton143fcc32011-04-13 00:18:08 +0000317 SetOptionValue (uint32_t option_idx, const char *option_arg);
Johnny Chena62ad7c2010-10-28 17:27:46 +0000318
319 void
Greg Clayton143fcc32011-04-13 00:18:08 +0000320 OptionParsingStarting ();
Johnny Chena62ad7c2010-10-28 17:27:46 +0000321
Greg Claytonb3448432011-03-24 21:19:54 +0000322 const OptionDefinition*
Johnny Chena62ad7c2010-10-28 17:27:46 +0000323 GetDefinitions ();
324
325 // Options table: Required for subclasses of Options.
326
Greg Claytonb3448432011-03-24 21:19:54 +0000327 static OptionDefinition g_option_table[];
Johnny Chena62ad7c2010-10-28 17:27:46 +0000328
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
336private:
337 CommandOptions m_options;
338};
339
340//-------------------------------------------------------------------------
Chris Lattner24943d22010-06-08 16:52:24 +0000341// CommandObjectBreakpointDelete
342//-------------------------------------------------------------------------
343
344class CommandObjectBreakpointDelete : public CommandObject
345{
346public:
Greg Clayton238c0a12010-09-18 01:14:36 +0000347 CommandObjectBreakpointDelete (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +0000348
349 virtual
350 ~CommandObjectBreakpointDelete ();
351
352 virtual bool
Greg Clayton238c0a12010-09-18 01:14:36 +0000353 Execute (Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +0000354 CommandReturnObject &result);
355
356private:
357};
358
359} // namespace lldb_private
360
361#endif // liblldb_CommandObjectBreakpoint_h_