blob: cdff75a0b48cd2e61727a9f5dbb75ae072e43b62 [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
Greg Clayton238c0a12010-09-18 01:14:36 +000063 CommandObjectBreakpointSet (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +000064
65 virtual
66 ~CommandObjectBreakpointSet ();
67
68 virtual bool
Greg Clayton238c0a12010-09-18 01:14:36 +000069 Execute (Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +000070 CommandReturnObject &result);
71
72 virtual Options *
73 GetOptions ();
74
75 class CommandOptions : public Options
76 {
77 public:
78
79 CommandOptions ();
80
81 virtual
82 ~CommandOptions ();
83
84 virtual Error
85 SetOptionValue (int option_idx, const char *option_arg);
86
87 void
88 ResetOptionValues ();
89
90 const lldb::OptionDefinition*
91 GetDefinitions ();
92
93 // Options table: Required for subclasses of Options.
94
95 static lldb::OptionDefinition g_option_table[];
96
97 // Instance variables to hold the values for command options.
98
99 std::string m_filename;
Greg Clayton12bec712010-06-28 21:30:43 +0000100 uint32_t m_line_num;
101 uint32_t m_column;
Chris Lattner24943d22010-06-08 16:52:24 +0000102 bool m_ignore_inlines;
103 std::string m_func_name;
Greg Clayton12bec712010-06-28 21:30:43 +0000104 uint32_t m_func_name_type_mask;
Chris Lattner24943d22010-06-08 16:52:24 +0000105 std::string m_func_regexp;
Chris Lattner24943d22010-06-08 16:52:24 +0000106 STLStringArray m_modules;
Greg Clayton54e7afa2010-07-09 20:39:50 +0000107 lldb::addr_t m_load_addr;
108 uint32_t m_ignore_count;
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000109 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
Greg Clayton238c0a12010-09-18 01:14:36 +0000129 CommandObjectBreakpointModify (CommandInterpreter &interpreter);
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 Clayton238c0a12010-09-18 01:14:36 +0000135 Execute (Args& command,
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000136 CommandReturnObject &result);
137
138 virtual Options *
139 GetOptions ();
140
141 class CommandOptions : public Options
142 {
143 public:
144
145 CommandOptions ();
146
147 virtual
148 ~CommandOptions ();
149
150 virtual Error
151 SetOptionValue (int option_idx, const char *option_arg);
152
153 void
154 ResetOptionValues ();
155
156 const lldb::OptionDefinition*
157 GetDefinitions ();
158
159 // Options table: Required for subclasses of Options.
160
161 static lldb::OptionDefinition g_option_table[];
162
163 // Instance variables to hold the values for command options.
164
Greg Clayton54e7afa2010-07-09 20:39:50 +0000165 uint32_t m_ignore_count;
Jim Ingham3c7b5b92010-06-16 02:00:15 +0000166 lldb::tid_t m_thread_id;
167 uint32_t m_thread_index;
168 std::string m_thread_name;
169 std::string m_queue_name;
Jim Ingham10622a22010-06-18 00:58:52 +0000170 bool m_enable_passed;
171 bool m_enable_value;
Jim Inghamd4571222010-06-19 04:35:20 +0000172 bool m_name_passed;
173 bool m_queue_passed;
Chris Lattner24943d22010-06-08 16:52:24 +0000174
175 };
176
177private:
178 CommandOptions m_options;
179};
180
181//-------------------------------------------------------------------------
182// CommandObjectBreakpointEnable
183//-------------------------------------------------------------------------
184
185class CommandObjectBreakpointEnable : public CommandObject
186{
187public:
Greg Clayton238c0a12010-09-18 01:14:36 +0000188 CommandObjectBreakpointEnable (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +0000189
190 virtual
191 ~CommandObjectBreakpointEnable ();
192
193 virtual bool
Greg Clayton238c0a12010-09-18 01:14:36 +0000194 Execute (Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +0000195 CommandReturnObject &result);
196
197private:
198};
199
200//-------------------------------------------------------------------------
201// CommandObjectBreakpointDisable
202//-------------------------------------------------------------------------
203
204class CommandObjectBreakpointDisable : public CommandObject
205{
206public:
Greg Clayton238c0a12010-09-18 01:14:36 +0000207 CommandObjectBreakpointDisable (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +0000208
209 virtual
210 ~CommandObjectBreakpointDisable ();
211
212 virtual bool
Greg Clayton238c0a12010-09-18 01:14:36 +0000213 Execute (Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +0000214 CommandReturnObject &result);
215
216private:
217};
218
219//-------------------------------------------------------------------------
220// CommandObjectBreakpointList
221//-------------------------------------------------------------------------
222
223class CommandObjectBreakpointList : public CommandObject
224{
225public:
Greg Clayton238c0a12010-09-18 01:14:36 +0000226 CommandObjectBreakpointList (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +0000227
228 virtual
229 ~CommandObjectBreakpointList ();
230
231 virtual bool
Greg Clayton238c0a12010-09-18 01:14:36 +0000232 Execute (Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +0000233 CommandReturnObject &result);
234
235 virtual Options *
236 GetOptions ();
237
238 class CommandOptions : public Options
239 {
240 public:
241
242 CommandOptions ();
243
244 virtual
245 ~CommandOptions ();
246
247 virtual Error
248 SetOptionValue (int option_idx, const char *option_arg);
249
250 void
251 ResetOptionValues ();
252
253 const lldb::OptionDefinition *
254 GetDefinitions ();
255
256 // Options table: Required for subclasses of Options.
257
258 static lldb::OptionDefinition g_option_table[];
259
260 // Instance variables to hold the values for command options.
261
262 lldb::DescriptionLevel m_level;
263
264 bool m_internal;
265 };
266
267private:
268 CommandOptions m_options;
269};
270
271//-------------------------------------------------------------------------
272// CommandObjectBreakpointDelete
273//-------------------------------------------------------------------------
274
275class CommandObjectBreakpointDelete : public CommandObject
276{
277public:
Greg Clayton238c0a12010-09-18 01:14:36 +0000278 CommandObjectBreakpointDelete (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +0000279
280 virtual
281 ~CommandObjectBreakpointDelete ();
282
283 virtual bool
Greg Clayton238c0a12010-09-18 01:14:36 +0000284 Execute (Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +0000285 CommandReturnObject &result);
286
287private:
288};
289
290} // namespace lldb_private
291
292#endif // liblldb_CommandObjectBreakpoint_h_