blob: 5374146ff47848af42acc8f1d6e35e013191519a [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;
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
195 Execute (Args& command,
196 CommandContext *context,
197 CommandInterpreter *interpreter,
198 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
216 Execute (Args& command,
217 CommandContext *context,
218 CommandInterpreter *interpreter,
219 CommandReturnObject &result);
220
221private:
222};
223
224//-------------------------------------------------------------------------
225// CommandObjectBreakpointList
226//-------------------------------------------------------------------------
227
228class CommandObjectBreakpointList : public CommandObject
229{
230public:
231 CommandObjectBreakpointList ();
232
233 virtual
234 ~CommandObjectBreakpointList ();
235
236 virtual bool
237 Execute (Args& command,
238 CommandContext *context,
239 CommandInterpreter *interpreter,
240 CommandReturnObject &result);
241
242 virtual Options *
243 GetOptions ();
244
245 class CommandOptions : public Options
246 {
247 public:
248
249 CommandOptions ();
250
251 virtual
252 ~CommandOptions ();
253
254 virtual Error
255 SetOptionValue (int option_idx, const char *option_arg);
256
257 void
258 ResetOptionValues ();
259
260 const lldb::OptionDefinition *
261 GetDefinitions ();
262
263 // Options table: Required for subclasses of Options.
264
265 static lldb::OptionDefinition g_option_table[];
266
267 // Instance variables to hold the values for command options.
268
269 lldb::DescriptionLevel m_level;
270
271 bool m_internal;
272 };
273
274private:
275 CommandOptions m_options;
276};
277
278//-------------------------------------------------------------------------
279// CommandObjectBreakpointDelete
280//-------------------------------------------------------------------------
281
282class CommandObjectBreakpointDelete : public CommandObject
283{
284public:
285 CommandObjectBreakpointDelete ();
286
287 virtual
288 ~CommandObjectBreakpointDelete ();
289
290 virtual bool
291 Execute (Args& command,
292 CommandContext *context,
293 CommandInterpreter *interpreter,
294 CommandReturnObject &result);
295
296private:
297};
298
299} // namespace lldb_private
300
301#endif // liblldb_CommandObjectBreakpoint_h_