blob: fb13576479a6b571b341797571e8a1865c0e8c78 [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
79 CommandOptions ();
80
81 virtual
82 ~CommandOptions ();
83
84 virtual Error
85 SetOptionValue (int option_idx, const char *option_arg);
86
87 void
88 ResetOptionValues ();
89
90 const lldb::OptionDefinition*
91 GetDefinitions ();
92
93 // Options table: Required for subclasses of Options.
94
95 static lldb::OptionDefinition g_option_table[];
96
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;
Chris Lattner24943d22010-06-08 16:52:24 +0000102 bool m_ignore_inlines;
103 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
145 CommandOptions ();
146
147 virtual
148 ~CommandOptions ();
149
150 virtual Error
151 SetOptionValue (int option_idx, const char *option_arg);
152
153 void
154 ResetOptionValues ();
155
156 const lldb::OptionDefinition*
157 GetDefinitions ();
158
159 // Options table: Required for subclasses of Options.
160
161 static lldb::OptionDefinition g_option_table[];
162
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;
167 uint32_t m_thread_index;
168 std::string m_thread_name;
169 std::string m_queue_name;
Jim Inghamd1686902010-10-14 23:45:03 +0000170 std::string m_condition;
Jim Ingham10622a22010-06-18 00:58:52 +0000171 bool m_enable_passed;
172 bool m_enable_value;
Jim Inghamd4571222010-06-19 04:35:20 +0000173 bool m_name_passed;
174 bool m_queue_passed;
Jim Inghamd1686902010-10-14 23:45:03 +0000175 bool m_condition_passed;
Chris Lattner24943d22010-06-08 16:52:24 +0000176
177 };
178
179private:
180 CommandOptions m_options;
181};
182
183//-------------------------------------------------------------------------
184// CommandObjectBreakpointEnable
185//-------------------------------------------------------------------------
186
187class CommandObjectBreakpointEnable : public CommandObject
188{
189public:
Greg Clayton238c0a12010-09-18 01:14:36 +0000190 CommandObjectBreakpointEnable (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +0000191
192 virtual
193 ~CommandObjectBreakpointEnable ();
194
195 virtual bool
Greg Clayton238c0a12010-09-18 01:14:36 +0000196 Execute (Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +0000197 CommandReturnObject &result);
198
199private:
200};
201
202//-------------------------------------------------------------------------
203// CommandObjectBreakpointDisable
204//-------------------------------------------------------------------------
205
206class CommandObjectBreakpointDisable : public CommandObject
207{
208public:
Greg Clayton238c0a12010-09-18 01:14:36 +0000209 CommandObjectBreakpointDisable (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +0000210
211 virtual
212 ~CommandObjectBreakpointDisable ();
213
214 virtual bool
Greg Clayton238c0a12010-09-18 01:14:36 +0000215 Execute (Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +0000216 CommandReturnObject &result);
217
218private:
219};
220
221//-------------------------------------------------------------------------
222// CommandObjectBreakpointList
223//-------------------------------------------------------------------------
224
225class CommandObjectBreakpointList : public CommandObject
226{
227public:
Greg Clayton238c0a12010-09-18 01:14:36 +0000228 CommandObjectBreakpointList (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +0000229
230 virtual
231 ~CommandObjectBreakpointList ();
232
233 virtual bool
Greg Clayton238c0a12010-09-18 01:14:36 +0000234 Execute (Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +0000235 CommandReturnObject &result);
236
237 virtual Options *
238 GetOptions ();
239
240 class CommandOptions : public Options
241 {
242 public:
243
244 CommandOptions ();
245
246 virtual
247 ~CommandOptions ();
248
249 virtual Error
250 SetOptionValue (int option_idx, const char *option_arg);
251
252 void
253 ResetOptionValues ();
254
255 const lldb::OptionDefinition *
256 GetDefinitions ();
257
258 // Options table: Required for subclasses of Options.
259
260 static lldb::OptionDefinition g_option_table[];
261
262 // Instance variables to hold the values for command options.
263
264 lldb::DescriptionLevel m_level;
265
266 bool m_internal;
267 };
268
269private:
270 CommandOptions m_options;
271};
272
273//-------------------------------------------------------------------------
Johnny Chena62ad7c2010-10-28 17:27:46 +0000274// CommandObjectBreakpointClear
275//-------------------------------------------------------------------------
276
277
278class CommandObjectBreakpointClear : public CommandObject
279{
280public:
281
282 typedef enum BreakpointClearType
283 {
284 eClearTypeInvalid,
285 eClearTypeFileAndLine,
286 } BreakpointClearType;
287
288 CommandObjectBreakpointClear (CommandInterpreter &interpreter);
289
290 virtual
291 ~CommandObjectBreakpointClear ();
292
293 virtual bool
294 Execute (Args& command,
295 CommandReturnObject &result);
296
297 virtual Options *
298 GetOptions ();
299
300 class CommandOptions : public Options
301 {
302 public:
303
304 CommandOptions ();
305
306 virtual
307 ~CommandOptions ();
308
309 virtual Error
310 SetOptionValue (int option_idx, const char *option_arg);
311
312 void
313 ResetOptionValues ();
314
315 const lldb::OptionDefinition*
316 GetDefinitions ();
317
318 // Options table: Required for subclasses of Options.
319
320 static lldb::OptionDefinition g_option_table[];
321
322 // Instance variables to hold the values for command options.
323
324 std::string m_filename;
325 uint32_t m_line_num;
326
327 };
328
329private:
330 CommandOptions m_options;
331};
332
333//-------------------------------------------------------------------------
Chris Lattner24943d22010-06-08 16:52:24 +0000334// CommandObjectBreakpointDelete
335//-------------------------------------------------------------------------
336
337class CommandObjectBreakpointDelete : public CommandObject
338{
339public:
Greg Clayton238c0a12010-09-18 01:14:36 +0000340 CommandObjectBreakpointDelete (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +0000341
342 virtual
343 ~CommandObjectBreakpointDelete ();
344
345 virtual bool
Greg Clayton238c0a12010-09-18 01:14:36 +0000346 Execute (Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +0000347 CommandReturnObject &result);
348
349private:
350};
351
352} // namespace lldb_private
353
354#endif // liblldb_CommandObjectBreakpoint_h_