blob: e455ac08b3e04bfb40891afbfca4c196afc32ea2 [file] [log] [blame]
Johnny Chen01acfa72011-09-22 18:04:58 +00001//===-- CommandObjectWatchpoint.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_CommandObjectWatchpoint_h_
11#define liblldb_CommandObjectWatchpoint_h_
12
13// C Includes
14// C++ Includes
15
16// Other libraries and framework includes
17// Project includes
18#include "lldb/Interpreter/CommandObjectMultiword.h"
19#include "lldb/Interpreter/Options.h"
Johnny Chen55a2d5a2012-01-30 21:46:17 +000020#include "lldb/Interpreter/OptionGroupWatchpoint.h"
Johnny Chen01acfa72011-09-22 18:04:58 +000021
22namespace lldb_private {
23
24//-------------------------------------------------------------------------
25// CommandObjectMultiwordWatchpoint
26//-------------------------------------------------------------------------
27
28class CommandObjectMultiwordWatchpoint : public CommandObjectMultiword
29{
30public:
31 CommandObjectMultiwordWatchpoint (CommandInterpreter &interpreter);
32
33 virtual
34 ~CommandObjectMultiwordWatchpoint ();
35};
36
37//-------------------------------------------------------------------------
38// CommandObjectWatchpointList
39//-------------------------------------------------------------------------
40
41class CommandObjectWatchpointList : public CommandObject
42{
43public:
44 CommandObjectWatchpointList (CommandInterpreter &interpreter);
45
46 virtual
47 ~CommandObjectWatchpointList ();
48
49 virtual bool
50 Execute (Args& command,
51 CommandReturnObject &result);
52
53 virtual Options *
54 GetOptions ();
55
56 class CommandOptions : public Options
57 {
58 public:
59
60 CommandOptions (CommandInterpreter &interpreter);
61
62 virtual
63 ~CommandOptions ();
64
65 virtual Error
66 SetOptionValue (uint32_t option_idx, const char *option_arg);
67
68 void
69 OptionParsingStarting ();
70
71 const OptionDefinition *
72 GetDefinitions ();
73
74 // Options table: Required for subclasses of Options.
75
76 static OptionDefinition g_option_table[];
77
78 // Instance variables to hold the values for command options.
79
80 lldb::DescriptionLevel m_level;
81 };
82
83private:
84 CommandOptions m_options;
85};
86
87//-------------------------------------------------------------------------
88// CommandObjectWatchpointEnable
89//-------------------------------------------------------------------------
90
91class CommandObjectWatchpointEnable : public CommandObject
92{
93public:
94 CommandObjectWatchpointEnable (CommandInterpreter &interpreter);
95
96 virtual
97 ~CommandObjectWatchpointEnable ();
98
99 virtual bool
100 Execute (Args& command,
101 CommandReturnObject &result);
102
103private:
104};
105
106//-------------------------------------------------------------------------
107// CommandObjectWatchpointDisable
108//-------------------------------------------------------------------------
109
110class CommandObjectWatchpointDisable : public CommandObject
111{
112public:
113 CommandObjectWatchpointDisable (CommandInterpreter &interpreter);
114
115 virtual
116 ~CommandObjectWatchpointDisable ();
117
118 virtual bool
119 Execute (Args& command,
120 CommandReturnObject &result);
121
122private:
123};
124
125//-------------------------------------------------------------------------
126// CommandObjectWatchpointDelete
127//-------------------------------------------------------------------------
128
129class CommandObjectWatchpointDelete : public CommandObject
130{
131public:
132 CommandObjectWatchpointDelete (CommandInterpreter &interpreter);
133
134 virtual
135 ~CommandObjectWatchpointDelete ();
136
137 virtual bool
138 Execute (Args& command,
139 CommandReturnObject &result);
140
141private:
142};
143
Johnny Chene14cf4e2011-10-05 21:35:46 +0000144//-------------------------------------------------------------------------
145// CommandObjectWatchpointIgnore
146//-------------------------------------------------------------------------
147
148class CommandObjectWatchpointIgnore : public CommandObject
149{
150public:
151 CommandObjectWatchpointIgnore (CommandInterpreter &interpreter);
152
153 virtual
154 ~CommandObjectWatchpointIgnore ();
155
156 virtual bool
157 Execute (Args& command,
158 CommandReturnObject &result);
159
160 virtual Options *
161 GetOptions ();
162
163 class CommandOptions : public Options
164 {
165 public:
166
167 CommandOptions (CommandInterpreter &interpreter);
168
169 virtual
170 ~CommandOptions ();
171
172 virtual Error
173 SetOptionValue (uint32_t option_idx, const char *option_arg);
174
175 void
176 OptionParsingStarting ();
177
178 const OptionDefinition *
179 GetDefinitions ();
180
181 // Options table: Required for subclasses of Options.
182
183 static OptionDefinition g_option_table[];
184
185 // Instance variables to hold the values for command options.
186
187 uint32_t m_ignore_count;
188 };
189
190private:
191 CommandOptions m_options;
192};
193
Johnny Chen712a6282011-10-17 18:58:00 +0000194//-------------------------------------------------------------------------
195// CommandObjectWatchpointModify
196//-------------------------------------------------------------------------
197
198class CommandObjectWatchpointModify : public CommandObject
199{
200public:
201
202 CommandObjectWatchpointModify (CommandInterpreter &interpreter);
203
204 virtual
205 ~CommandObjectWatchpointModify ();
206
207 virtual bool
208 Execute (Args& command,
209 CommandReturnObject &result);
210
211 virtual Options *
212 GetOptions ();
213
214 class CommandOptions : public Options
215 {
216 public:
217
218 CommandOptions (CommandInterpreter &interpreter);
219
220 virtual
221 ~CommandOptions ();
222
223 virtual Error
224 SetOptionValue (uint32_t option_idx, const char *option_arg);
225
226 void
227 OptionParsingStarting ();
228
229 const OptionDefinition*
230 GetDefinitions ();
231
232 // Options table: Required for subclasses of Options.
233
234 static OptionDefinition g_option_table[];
235
236 // Instance variables to hold the values for command options.
237
238 std::string m_condition;
239 bool m_condition_passed;
240 };
241
242private:
243 CommandOptions m_options;
244};
245
Johnny Chen55a2d5a2012-01-30 21:46:17 +0000246//-------------------------------------------------------------------------
247// CommandObjectWatchpointSet
248//-------------------------------------------------------------------------
249
Johnny Chen42404d22012-02-08 22:37:48 +0000250class CommandObjectWatchpointSet : public CommandObjectMultiword
Johnny Chen55a2d5a2012-01-30 21:46:17 +0000251{
252public:
253
254 CommandObjectWatchpointSet (CommandInterpreter &interpreter);
255
256 virtual
257 ~CommandObjectWatchpointSet ();
258
Johnny Chen42404d22012-02-08 22:37:48 +0000259
260};
261
262class CommandObjectWatchpointSetVariable : public CommandObject
263{
264public:
265
266 CommandObjectWatchpointSetVariable (CommandInterpreter &interpreter);
267
268 virtual
269 ~CommandObjectWatchpointSetVariable ();
270
Johnny Chen55a2d5a2012-01-30 21:46:17 +0000271 virtual bool
272 Execute (Args& command,
273 CommandReturnObject &result);
274
275 virtual Options *
276 GetOptions ();
277
278private:
279 OptionGroupOptions m_option_group;
280 OptionGroupWatchpoint m_option_watchpoint;
Johnny Chen42404d22012-02-08 22:37:48 +0000281};
282
283class CommandObjectWatchpointSetExpression : public CommandObject
284{
285public:
286
287 CommandObjectWatchpointSetExpression (CommandInterpreter &interpreter);
288
289 virtual
290 ~CommandObjectWatchpointSetExpression ();
291
292 virtual bool
293 Execute (Args& command,
294 CommandReturnObject &result)
295 { return false; }
296
297 virtual bool
298 WantsRawCommandString() { return true; }
299
300 // Overrides base class's behavior where WantsCompletion = !WantsRawCommandString.
301 virtual bool
302 WantsCompletion() { return true; }
303
304 virtual bool
305 ExecuteRawCommandString (const char *raw_command,
306 CommandReturnObject &result);
307
308 virtual Options *
309 GetOptions ();
310
311private:
312 OptionGroupOptions m_option_group;
313 OptionGroupWatchpoint m_option_watchpoint;
Johnny Chen55a2d5a2012-01-30 21:46:17 +0000314};
315
Johnny Chen01acfa72011-09-22 18:04:58 +0000316} // namespace lldb_private
317
318#endif // liblldb_CommandObjectWatchpoint_h_