1 //===-- 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"
20 #include "lldb/Interpreter/OptionGroupWatchpoint.h"
21 
22 namespace lldb_private {
23 
24 //-------------------------------------------------------------------------
25 // CommandObjectMultiwordWatchpoint
26 //-------------------------------------------------------------------------
27 
28 class CommandObjectMultiwordWatchpoint : public CommandObjectMultiword
29 {
30 public:
31     CommandObjectMultiwordWatchpoint (CommandInterpreter &interpreter);
32 
33     virtual
34     ~CommandObjectMultiwordWatchpoint ();
35 };
36 
37 //-------------------------------------------------------------------------
38 // CommandObjectWatchpointList
39 //-------------------------------------------------------------------------
40 
41 class CommandObjectWatchpointList : public CommandObject
42 {
43 public:
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 
83 private:
84     CommandOptions m_options;
85 };
86 
87 //-------------------------------------------------------------------------
88 // CommandObjectWatchpointEnable
89 //-------------------------------------------------------------------------
90 
91 class CommandObjectWatchpointEnable : public CommandObject
92 {
93 public:
94     CommandObjectWatchpointEnable (CommandInterpreter &interpreter);
95 
96     virtual
97     ~CommandObjectWatchpointEnable ();
98 
99     virtual bool
100     Execute (Args& command,
101              CommandReturnObject &result);
102 
103 private:
104 };
105 
106 //-------------------------------------------------------------------------
107 // CommandObjectWatchpointDisable
108 //-------------------------------------------------------------------------
109 
110 class CommandObjectWatchpointDisable : public CommandObject
111 {
112 public:
113     CommandObjectWatchpointDisable (CommandInterpreter &interpreter);
114 
115     virtual
116     ~CommandObjectWatchpointDisable ();
117 
118     virtual bool
119     Execute (Args& command,
120              CommandReturnObject &result);
121 
122 private:
123 };
124 
125 //-------------------------------------------------------------------------
126 // CommandObjectWatchpointDelete
127 //-------------------------------------------------------------------------
128 
129 class CommandObjectWatchpointDelete : public CommandObject
130 {
131 public:
132     CommandObjectWatchpointDelete (CommandInterpreter &interpreter);
133 
134     virtual
135     ~CommandObjectWatchpointDelete ();
136 
137     virtual bool
138     Execute (Args& command,
139              CommandReturnObject &result);
140 
141 private:
142 };
143 
144 //-------------------------------------------------------------------------
145 // CommandObjectWatchpointIgnore
146 //-------------------------------------------------------------------------
147 
148 class CommandObjectWatchpointIgnore : public CommandObject
149 {
150 public:
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 
190 private:
191     CommandOptions m_options;
192 };
193 
194 //-------------------------------------------------------------------------
195 // CommandObjectWatchpointModify
196 //-------------------------------------------------------------------------
197 
198 class CommandObjectWatchpointModify : public CommandObject
199 {
200 public:
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 
242 private:
243     CommandOptions m_options;
244 };
245 
246 //-------------------------------------------------------------------------
247 // CommandObjectWatchpointSet
248 //-------------------------------------------------------------------------
249 
250 class CommandObjectWatchpointSet : public CommandObjectMultiword
251 {
252 public:
253 
254     CommandObjectWatchpointSet (CommandInterpreter &interpreter);
255 
256     virtual
257     ~CommandObjectWatchpointSet ();
258 
259 
260 };
261 
262 class CommandObjectWatchpointSetVariable : public CommandObject
263 {
264 public:
265 
266     CommandObjectWatchpointSetVariable (CommandInterpreter &interpreter);
267 
268     virtual
269     ~CommandObjectWatchpointSetVariable ();
270 
271     virtual bool
272     Execute (Args& command,
273              CommandReturnObject &result);
274 
275     virtual Options *
276     GetOptions ();
277 
278 private:
279     OptionGroupOptions m_option_group;
280     OptionGroupWatchpoint m_option_watchpoint;
281 };
282 
283 class CommandObjectWatchpointSetExpression : public CommandObject
284 {
285 public:
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 
311 private:
312     OptionGroupOptions m_option_group;
313     OptionGroupWatchpoint m_option_watchpoint;
314 };
315 
316 } // namespace lldb_private
317 
318 #endif  // liblldb_CommandObjectWatchpoint_h_
319