blob: c9447452adc9553c18731e532ff9296ea90e82e7 [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 Ingham2cf5ccb2012-05-22 00:12:20 +0000119 LazyBool m_skip_prologue;
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000120
121 };
122
123private:
Jim Ingham03c8ee52011-09-21 01:17:13 +0000124 bool
Jim Inghamd6d47972011-09-23 00:54:11 +0000125 GetDefaultFile (Target *target, FileSpec &file, CommandReturnObject &result);
Jim Ingham03c8ee52011-09-21 01:17:13 +0000126
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000127 CommandOptions m_options;
128};
129
130//-------------------------------------------------------------------------
Jim Ingham10622a22010-06-18 00:58:52 +0000131// CommandObjectMultiwordBreakpointModify
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000132//-------------------------------------------------------------------------
133
134
Jim Ingham10622a22010-06-18 00:58:52 +0000135class CommandObjectBreakpointModify : public CommandObject
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000136{
137public:
138
Greg Clayton238c0a12010-09-18 01:14:36 +0000139 CommandObjectBreakpointModify (CommandInterpreter &interpreter);
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000140
141 virtual
Jim Ingham10622a22010-06-18 00:58:52 +0000142 ~CommandObjectBreakpointModify ();
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000143
144 virtual bool
Greg Clayton238c0a12010-09-18 01:14:36 +0000145 Execute (Args& command,
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000146 CommandReturnObject &result);
147
148 virtual Options *
149 GetOptions ();
150
151 class CommandOptions : public Options
152 {
153 public:
154
Greg Claytonf15996e2011-04-07 22:46:35 +0000155 CommandOptions (CommandInterpreter &interpreter);
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000156
157 virtual
158 ~CommandOptions ();
159
160 virtual Error
Greg Clayton143fcc32011-04-13 00:18:08 +0000161 SetOptionValue (uint32_t option_idx, const char *option_arg);
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000162
163 void
Greg Clayton143fcc32011-04-13 00:18:08 +0000164 OptionParsingStarting ();
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000165
Greg Claytonb3448432011-03-24 21:19:54 +0000166 const OptionDefinition*
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000167 GetDefinitions ();
168
169 // Options table: Required for subclasses of Options.
170
Greg Claytonb3448432011-03-24 21:19:54 +0000171 static OptionDefinition g_option_table[];
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000172
173 // Instance variables to hold the values for command options.
174
Greg Clayton54e7afa2010-07-09 20:39:50 +0000175 uint32_t m_ignore_count;
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000176 lldb::tid_t m_thread_id;
Jim Ingham9a7b2912010-12-03 23:04:19 +0000177 bool m_thread_id_passed;
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000178 uint32_t m_thread_index;
Jim Ingham9a7b2912010-12-03 23:04:19 +0000179 bool m_thread_index_passed;
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000180 std::string m_thread_name;
181 std::string m_queue_name;
Jim Inghamd1686902010-10-14 23:45:03 +0000182 std::string m_condition;
Jim Ingham10622a22010-06-18 00:58:52 +0000183 bool m_enable_passed;
184 bool m_enable_value;
Jim Inghamd4571222010-06-19 04:35:20 +0000185 bool m_name_passed;
186 bool m_queue_passed;
Jim Inghamd1686902010-10-14 23:45:03 +0000187 bool m_condition_passed;
Chris Lattner24943d22010-06-08 16:52:24 +0000188
189 };
190
191private:
192 CommandOptions m_options;
193};
194
195//-------------------------------------------------------------------------
196// CommandObjectBreakpointEnable
197//-------------------------------------------------------------------------
198
199class CommandObjectBreakpointEnable : public CommandObject
200{
201public:
Greg Clayton238c0a12010-09-18 01:14:36 +0000202 CommandObjectBreakpointEnable (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +0000203
204 virtual
205 ~CommandObjectBreakpointEnable ();
206
207 virtual bool
Greg Clayton238c0a12010-09-18 01:14:36 +0000208 Execute (Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +0000209 CommandReturnObject &result);
210
211private:
212};
213
214//-------------------------------------------------------------------------
215// CommandObjectBreakpointDisable
216//-------------------------------------------------------------------------
217
218class CommandObjectBreakpointDisable : public CommandObject
219{
220public:
Greg Clayton238c0a12010-09-18 01:14:36 +0000221 CommandObjectBreakpointDisable (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +0000222
223 virtual
224 ~CommandObjectBreakpointDisable ();
225
226 virtual bool
Greg Clayton238c0a12010-09-18 01:14:36 +0000227 Execute (Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +0000228 CommandReturnObject &result);
229
230private:
231};
232
233//-------------------------------------------------------------------------
234// CommandObjectBreakpointList
235//-------------------------------------------------------------------------
236
237class CommandObjectBreakpointList : public CommandObject
238{
239public:
Greg Clayton238c0a12010-09-18 01:14:36 +0000240 CommandObjectBreakpointList (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +0000241
242 virtual
243 ~CommandObjectBreakpointList ();
244
245 virtual bool
Greg Clayton238c0a12010-09-18 01:14:36 +0000246 Execute (Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +0000247 CommandReturnObject &result);
248
249 virtual Options *
250 GetOptions ();
251
252 class CommandOptions : public Options
253 {
254 public:
255
Greg Claytonf15996e2011-04-07 22:46:35 +0000256 CommandOptions (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +0000257
258 virtual
259 ~CommandOptions ();
260
261 virtual Error
Greg Clayton143fcc32011-04-13 00:18:08 +0000262 SetOptionValue (uint32_t option_idx, const char *option_arg);
Chris Lattner24943d22010-06-08 16:52:24 +0000263
264 void
Greg Clayton143fcc32011-04-13 00:18:08 +0000265 OptionParsingStarting ();
Chris Lattner24943d22010-06-08 16:52:24 +0000266
Greg Claytonb3448432011-03-24 21:19:54 +0000267 const OptionDefinition *
Chris Lattner24943d22010-06-08 16:52:24 +0000268 GetDefinitions ();
269
270 // Options table: Required for subclasses of Options.
271
Greg Claytonb3448432011-03-24 21:19:54 +0000272 static OptionDefinition g_option_table[];
Chris Lattner24943d22010-06-08 16:52:24 +0000273
274 // Instance variables to hold the values for command options.
275
276 lldb::DescriptionLevel m_level;
277
278 bool m_internal;
279 };
280
281private:
282 CommandOptions m_options;
283};
284
285//-------------------------------------------------------------------------
Johnny Chena62ad7c2010-10-28 17:27:46 +0000286// CommandObjectBreakpointClear
287//-------------------------------------------------------------------------
288
289
290class CommandObjectBreakpointClear : public CommandObject
291{
292public:
293
294 typedef enum BreakpointClearType
295 {
296 eClearTypeInvalid,
Greg Clayton17f5afe2011-02-05 02:56:16 +0000297 eClearTypeFileAndLine
Johnny Chena62ad7c2010-10-28 17:27:46 +0000298 } BreakpointClearType;
299
300 CommandObjectBreakpointClear (CommandInterpreter &interpreter);
301
302 virtual
303 ~CommandObjectBreakpointClear ();
304
305 virtual bool
306 Execute (Args& command,
307 CommandReturnObject &result);
308
309 virtual Options *
310 GetOptions ();
311
312 class CommandOptions : public Options
313 {
314 public:
315
Greg Claytonf15996e2011-04-07 22:46:35 +0000316 CommandOptions (CommandInterpreter &interpreter);
Johnny Chena62ad7c2010-10-28 17:27:46 +0000317
318 virtual
319 ~CommandOptions ();
320
321 virtual Error
Greg Clayton143fcc32011-04-13 00:18:08 +0000322 SetOptionValue (uint32_t option_idx, const char *option_arg);
Johnny Chena62ad7c2010-10-28 17:27:46 +0000323
324 void
Greg Clayton143fcc32011-04-13 00:18:08 +0000325 OptionParsingStarting ();
Johnny Chena62ad7c2010-10-28 17:27:46 +0000326
Greg Claytonb3448432011-03-24 21:19:54 +0000327 const OptionDefinition*
Johnny Chena62ad7c2010-10-28 17:27:46 +0000328 GetDefinitions ();
329
330 // Options table: Required for subclasses of Options.
331
Greg Claytonb3448432011-03-24 21:19:54 +0000332 static OptionDefinition g_option_table[];
Johnny Chena62ad7c2010-10-28 17:27:46 +0000333
334 // Instance variables to hold the values for command options.
335
336 std::string m_filename;
337 uint32_t m_line_num;
338
339 };
340
341private:
342 CommandOptions m_options;
343};
344
345//-------------------------------------------------------------------------
Chris Lattner24943d22010-06-08 16:52:24 +0000346// CommandObjectBreakpointDelete
347//-------------------------------------------------------------------------
348
349class CommandObjectBreakpointDelete : public CommandObject
350{
351public:
Greg Clayton238c0a12010-09-18 01:14:36 +0000352 CommandObjectBreakpointDelete (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +0000353
354 virtual
355 ~CommandObjectBreakpointDelete ();
356
357 virtual bool
Greg Clayton238c0a12010-09-18 01:14:36 +0000358 Execute (Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +0000359 CommandReturnObject &result);
360
361private:
362};
363
364} // namespace lldb_private
365
366#endif // liblldb_CommandObjectBreakpoint_h_