blob: 053e036c0c810437a9f59650a025a05312a8bca3 [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:
35 CommandObjectMultiwordBreakpoint (CommandInterpreter *interpreter);
36
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
69 Execute (Args& command,
70 CommandContext *context,
71 CommandInterpreter *interpreter,
72 CommandReturnObject &result);
73
74 virtual Options *
75 GetOptions ();
76
77 class CommandOptions : public Options
78 {
79 public:
80
81 CommandOptions ();
82
83 virtual
84 ~CommandOptions ();
85
86 virtual Error
87 SetOptionValue (int option_idx, const char *option_arg);
88
89 void
90 ResetOptionValues ();
91
92 const lldb::OptionDefinition*
93 GetDefinitions ();
94
95 // Options table: Required for subclasses of Options.
96
97 static lldb::OptionDefinition g_option_table[];
98
99 // Instance variables to hold the values for command options.
100
101 std::string m_filename;
102 unsigned int m_line_num;
103 unsigned int m_column;
104 bool m_ignore_inlines;
105 std::string m_func_name;
106 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
136 Execute (Args& command,
137 CommandContext *context,
138 CommandInterpreter *interpreter,
139 CommandReturnObject &result);
140
141 virtual Options *
142 GetOptions ();
143
144 class CommandOptions : public Options
145 {
146 public:
147
148 CommandOptions ();
149
150 virtual
151 ~CommandOptions ();
152
153 virtual Error
154 SetOptionValue (int option_idx, const char *option_arg);
155
156 void
157 ResetOptionValues ();
158
159 const lldb::OptionDefinition*
160 GetDefinitions ();
161
162 // Options table: Required for subclasses of Options.
163
164 static lldb::OptionDefinition g_option_table[];
165
166 // Instance variables to hold the values for command options.
167
168 int32_t m_ignore_count;
169 lldb::tid_t m_thread_id;
170 uint32_t m_thread_index;
171 std::string m_thread_name;
172 std::string m_queue_name;
Jim Ingham10622a22010-06-18 00:58:52 +0000173 bool m_enable_passed;
174 bool m_enable_value;
Jim Inghamd4571222010-06-19 04:35:20 +0000175 bool m_name_passed;
176 bool m_queue_passed;
Chris Lattner24943d22010-06-08 16:52:24 +0000177
178 };
179
180private:
181 CommandOptions m_options;
182};
183
184//-------------------------------------------------------------------------
185// CommandObjectBreakpointEnable
186//-------------------------------------------------------------------------
187
188class CommandObjectBreakpointEnable : public CommandObject
189{
190public:
191 CommandObjectBreakpointEnable ();
192
193 virtual
194 ~CommandObjectBreakpointEnable ();
195
196 virtual bool
197 Execute (Args& command,
198 CommandContext *context,
199 CommandInterpreter *interpreter,
200 CommandReturnObject &result);
201
202private:
203};
204
205//-------------------------------------------------------------------------
206// CommandObjectBreakpointDisable
207//-------------------------------------------------------------------------
208
209class CommandObjectBreakpointDisable : public CommandObject
210{
211public:
212 CommandObjectBreakpointDisable ();
213
214 virtual
215 ~CommandObjectBreakpointDisable ();
216
217 virtual bool
218 Execute (Args& command,
219 CommandContext *context,
220 CommandInterpreter *interpreter,
221 CommandReturnObject &result);
222
223private:
224};
225
226//-------------------------------------------------------------------------
227// CommandObjectBreakpointList
228//-------------------------------------------------------------------------
229
230class CommandObjectBreakpointList : public CommandObject
231{
232public:
233 CommandObjectBreakpointList ();
234
235 virtual
236 ~CommandObjectBreakpointList ();
237
238 virtual bool
239 Execute (Args& command,
240 CommandContext *context,
241 CommandInterpreter *interpreter,
242 CommandReturnObject &result);
243
244 virtual Options *
245 GetOptions ();
246
247 class CommandOptions : public Options
248 {
249 public:
250
251 CommandOptions ();
252
253 virtual
254 ~CommandOptions ();
255
256 virtual Error
257 SetOptionValue (int option_idx, const char *option_arg);
258
259 void
260 ResetOptionValues ();
261
262 const lldb::OptionDefinition *
263 GetDefinitions ();
264
265 // Options table: Required for subclasses of Options.
266
267 static lldb::OptionDefinition g_option_table[];
268
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//-------------------------------------------------------------------------
281// CommandObjectBreakpointDelete
282//-------------------------------------------------------------------------
283
284class CommandObjectBreakpointDelete : public CommandObject
285{
286public:
287 CommandObjectBreakpointDelete ();
288
289 virtual
290 ~CommandObjectBreakpointDelete ();
291
292 virtual bool
293 Execute (Args& command,
294 CommandContext *context,
295 CommandInterpreter *interpreter,
296 CommandReturnObject &result);
297
298private:
299};
300
301} // namespace lldb_private
302
303#endif // liblldb_CommandObjectBreakpoint_h_