blob: 92bea6988470d6af77cf00fff9454a4cbdb7d419 [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;
101 unsigned int m_line_num;
102 unsigned int m_column;
103 bool m_ignore_inlines;
104 std::string m_func_name;
105 std::string m_func_regexp;
106 lldb::addr_t m_load_addr;
107 STLStringArray m_modules;
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000108 int32_t m_ignore_count;
109 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
Jim Ingham10622a22010-06-18 00:58:52 +0000129 CommandObjectBreakpointModify ();
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 Clayton63094e02010-06-23 01:19:29 +0000135 Execute (CommandInterpreter &interpreter,
136 Args& command,
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000137 CommandReturnObject &result);
138
139 virtual Options *
140 GetOptions ();
141
142 class CommandOptions : public Options
143 {
144 public:
145
146 CommandOptions ();
147
148 virtual
149 ~CommandOptions ();
150
151 virtual Error
152 SetOptionValue (int option_idx, const char *option_arg);
153
154 void
155 ResetOptionValues ();
156
157 const lldb::OptionDefinition*
158 GetDefinitions ();
159
160 // Options table: Required for subclasses of Options.
161
162 static lldb::OptionDefinition g_option_table[];
163
164 // Instance variables to hold the values for command options.
165
166 int32_t m_ignore_count;
167 lldb::tid_t m_thread_id;
168 uint32_t m_thread_index;
169 std::string m_thread_name;
170 std::string m_queue_name;
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;
Chris Lattner24943d22010-06-08 16:52:24 +0000175
176 };
177
178private:
179 CommandOptions m_options;
180};
181
182//-------------------------------------------------------------------------
183// CommandObjectBreakpointEnable
184//-------------------------------------------------------------------------
185
186class CommandObjectBreakpointEnable : public CommandObject
187{
188public:
189 CommandObjectBreakpointEnable ();
190
191 virtual
192 ~CommandObjectBreakpointEnable ();
193
194 virtual bool
Greg Clayton63094e02010-06-23 01:19:29 +0000195 Execute (CommandInterpreter &interpreter,
196 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:
209 CommandObjectBreakpointDisable ();
210
211 virtual
212 ~CommandObjectBreakpointDisable ();
213
214 virtual bool
Greg Clayton63094e02010-06-23 01:19:29 +0000215 Execute (CommandInterpreter &interpreter,
216 Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +0000217 CommandReturnObject &result);
218
219private:
220};
221
222//-------------------------------------------------------------------------
223// CommandObjectBreakpointList
224//-------------------------------------------------------------------------
225
226class CommandObjectBreakpointList : public CommandObject
227{
228public:
229 CommandObjectBreakpointList ();
230
231 virtual
232 ~CommandObjectBreakpointList ();
233
234 virtual bool
Greg Clayton63094e02010-06-23 01:19:29 +0000235 Execute (CommandInterpreter &interpreter,
236 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
246 CommandOptions ();
247
248 virtual
249 ~CommandOptions ();
250
251 virtual Error
252 SetOptionValue (int option_idx, const char *option_arg);
253
254 void
255 ResetOptionValues ();
256
257 const lldb::OptionDefinition *
258 GetDefinitions ();
259
260 // Options table: Required for subclasses of Options.
261
262 static lldb::OptionDefinition g_option_table[];
263
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//-------------------------------------------------------------------------
276// CommandObjectBreakpointDelete
277//-------------------------------------------------------------------------
278
279class CommandObjectBreakpointDelete : public CommandObject
280{
281public:
282 CommandObjectBreakpointDelete ();
283
284 virtual
285 ~CommandObjectBreakpointDelete ();
286
287 virtual bool
Greg Clayton63094e02010-06-23 01:19:29 +0000288 Execute (CommandInterpreter &interpreter,
289 Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +0000290 CommandReturnObject &result);
291
292private:
293};
294
295} // namespace lldb_private
296
297#endif // liblldb_CommandObjectBreakpoint_h_