blob: 20f2c3b994a839ccbd96bf9893bb6c8634a55439 [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//-------------------------------------------------------------------------
46// CommandObjectMultiwordBreakpointSet
47//-------------------------------------------------------------------------
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
63 CommandObjectBreakpointSet ();
64
65 virtual
66 ~CommandObjectBreakpointSet ();
67
68 virtual bool
Greg Clayton63094e02010-06-23 01:19:29 +000069 Execute (CommandInterpreter &interpreter,
70 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
80 CommandOptions ();
81
82 virtual
83 ~CommandOptions ();
84
85 virtual Error
86 SetOptionValue (int option_idx, const char *option_arg);
87
88 void
89 ResetOptionValues ();
90
91 const lldb::OptionDefinition*
92 GetDefinitions ();
93
94 // Options table: Required for subclasses of Options.
95
96 static lldb::OptionDefinition g_option_table[];
97
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;
Chris Lattner24943d22010-06-08 16:52:24 +0000103 bool m_ignore_inlines;
104 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;
107 lldb::addr_t m_load_addr;
108 STLStringArray m_modules;
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000109 int32_t m_ignore_count;
110 lldb::tid_t m_thread_id;
111 uint32_t m_thread_index;
112 std::string m_thread_name;
113 std::string m_queue_name;
114
115 };
116
117private:
118 CommandOptions m_options;
119};
120
121//-------------------------------------------------------------------------
Jim Ingham10622a22010-06-18 00:58:52 +0000122// CommandObjectMultiwordBreakpointModify
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000123//-------------------------------------------------------------------------
124
125
Jim Ingham10622a22010-06-18 00:58:52 +0000126class CommandObjectBreakpointModify : public CommandObject
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000127{
128public:
129
Jim Ingham10622a22010-06-18 00:58:52 +0000130 CommandObjectBreakpointModify ();
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000131
132 virtual
Jim Ingham10622a22010-06-18 00:58:52 +0000133 ~CommandObjectBreakpointModify ();
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000134
135 virtual bool
Greg Clayton63094e02010-06-23 01:19:29 +0000136 Execute (CommandInterpreter &interpreter,
137 Args& command,
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000138 CommandReturnObject &result);
139
140 virtual Options *
141 GetOptions ();
142
143 class CommandOptions : public Options
144 {
145 public:
146
147 CommandOptions ();
148
149 virtual
150 ~CommandOptions ();
151
152 virtual Error
153 SetOptionValue (int option_idx, const char *option_arg);
154
155 void
156 ResetOptionValues ();
157
158 const lldb::OptionDefinition*
159 GetDefinitions ();
160
161 // Options table: Required for subclasses of Options.
162
163 static lldb::OptionDefinition g_option_table[];
164
165 // Instance variables to hold the values for command options.
166
167 int32_t m_ignore_count;
168 lldb::tid_t m_thread_id;
169 uint32_t m_thread_index;
170 std::string m_thread_name;
171 std::string m_queue_name;
Jim Ingham10622a22010-06-18 00:58:52 +0000172 bool m_enable_passed;
173 bool m_enable_value;
Jim Inghamd4571222010-06-19 04:35:20 +0000174 bool m_name_passed;
175 bool m_queue_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:
190 CommandObjectBreakpointEnable ();
191
192 virtual
193 ~CommandObjectBreakpointEnable ();
194
195 virtual bool
Greg Clayton63094e02010-06-23 01:19:29 +0000196 Execute (CommandInterpreter &interpreter,
197 Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +0000198 CommandReturnObject &result);
199
200private:
201};
202
203//-------------------------------------------------------------------------
204// CommandObjectBreakpointDisable
205//-------------------------------------------------------------------------
206
207class CommandObjectBreakpointDisable : public CommandObject
208{
209public:
210 CommandObjectBreakpointDisable ();
211
212 virtual
213 ~CommandObjectBreakpointDisable ();
214
215 virtual bool
Greg Clayton63094e02010-06-23 01:19:29 +0000216 Execute (CommandInterpreter &interpreter,
217 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:
230 CommandObjectBreakpointList ();
231
232 virtual
233 ~CommandObjectBreakpointList ();
234
235 virtual bool
Greg Clayton63094e02010-06-23 01:19:29 +0000236 Execute (CommandInterpreter &interpreter,
237 Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +0000238 CommandReturnObject &result);
239
240 virtual Options *
241 GetOptions ();
242
243 class CommandOptions : public Options
244 {
245 public:
246
247 CommandOptions ();
248
249 virtual
250 ~CommandOptions ();
251
252 virtual Error
253 SetOptionValue (int option_idx, const char *option_arg);
254
255 void
256 ResetOptionValues ();
257
258 const lldb::OptionDefinition *
259 GetDefinitions ();
260
261 // Options table: Required for subclasses of Options.
262
263 static lldb::OptionDefinition g_option_table[];
264
265 // Instance variables to hold the values for command options.
266
267 lldb::DescriptionLevel m_level;
268
269 bool m_internal;
270 };
271
272private:
273 CommandOptions m_options;
274};
275
276//-------------------------------------------------------------------------
277// CommandObjectBreakpointDelete
278//-------------------------------------------------------------------------
279
280class CommandObjectBreakpointDelete : public CommandObject
281{
282public:
283 CommandObjectBreakpointDelete ();
284
285 virtual
286 ~CommandObjectBreakpointDelete ();
287
288 virtual bool
Greg Clayton63094e02010-06-23 01:19:29 +0000289 Execute (CommandInterpreter &interpreter,
290 Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +0000291 CommandReturnObject &result);
292
293private:
294};
295
296} // namespace lldb_private
297
298#endif // liblldb_CommandObjectBreakpoint_h_