Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 1 | //===-- 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 Ingham | 84cdc15 | 2010-06-15 19:49:27 +0000 | [diff] [blame] | 23 | #include "lldb/Interpreter/Options.h" |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 24 | #include "lldb/Core/STLUtils.h" |
| 25 | |
| 26 | namespace lldb_private { |
| 27 | |
| 28 | //------------------------------------------------------------------------- |
| 29 | // CommandObjectMultiwordBreakpoint |
| 30 | //------------------------------------------------------------------------- |
| 31 | |
| 32 | class CommandObjectMultiwordBreakpoint : public CommandObjectMultiword |
| 33 | { |
| 34 | public: |
| 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 | |
| 50 | class CommandObjectBreakpointSet : public CommandObject |
| 51 | { |
| 52 | public: |
| 53 | |
| 54 | typedef enum BreakpointSetType |
| 55 | { |
| 56 | eSetTypeInvalid, |
| 57 | eSetTypeFileAndLine, |
| 58 | eSetTypeAddress, |
| 59 | eSetTypeFunctionName, |
Eli Friedman | b4a4728 | 2010-06-09 07:57:51 +0000 | [diff] [blame] | 60 | eSetTypeFunctionRegexp |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 61 | } 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 Ingham | 3c7b5b9 | 2010-06-16 02:00:15 +0000 | [diff] [blame] | 109 | 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 | |
| 117 | private: |
| 118 | CommandOptions m_options; |
| 119 | }; |
| 120 | |
| 121 | //------------------------------------------------------------------------- |
Jim Ingham | 10622a2 | 2010-06-18 00:58:52 +0000 | [diff] [blame^] | 122 | // CommandObjectMultiwordBreakpointModify |
Jim Ingham | 3c7b5b9 | 2010-06-16 02:00:15 +0000 | [diff] [blame] | 123 | //------------------------------------------------------------------------- |
| 124 | |
| 125 | |
Jim Ingham | 10622a2 | 2010-06-18 00:58:52 +0000 | [diff] [blame^] | 126 | class CommandObjectBreakpointModify : public CommandObject |
Jim Ingham | 3c7b5b9 | 2010-06-16 02:00:15 +0000 | [diff] [blame] | 127 | { |
| 128 | public: |
| 129 | |
Jim Ingham | 10622a2 | 2010-06-18 00:58:52 +0000 | [diff] [blame^] | 130 | CommandObjectBreakpointModify (); |
Jim Ingham | 3c7b5b9 | 2010-06-16 02:00:15 +0000 | [diff] [blame] | 131 | |
| 132 | virtual |
Jim Ingham | 10622a2 | 2010-06-18 00:58:52 +0000 | [diff] [blame^] | 133 | ~CommandObjectBreakpointModify (); |
Jim Ingham | 3c7b5b9 | 2010-06-16 02:00:15 +0000 | [diff] [blame] | 134 | |
| 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 Ingham | 10622a2 | 2010-06-18 00:58:52 +0000 | [diff] [blame^] | 173 | bool m_enable_passed; |
| 174 | bool m_enable_value; |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 175 | |
| 176 | }; |
| 177 | |
| 178 | private: |
| 179 | CommandOptions m_options; |
| 180 | }; |
| 181 | |
| 182 | //------------------------------------------------------------------------- |
| 183 | // CommandObjectBreakpointEnable |
| 184 | //------------------------------------------------------------------------- |
| 185 | |
| 186 | class CommandObjectBreakpointEnable : public CommandObject |
| 187 | { |
| 188 | public: |
| 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 | |
| 200 | private: |
| 201 | }; |
| 202 | |
| 203 | //------------------------------------------------------------------------- |
| 204 | // CommandObjectBreakpointDisable |
| 205 | //------------------------------------------------------------------------- |
| 206 | |
| 207 | class CommandObjectBreakpointDisable : public CommandObject |
| 208 | { |
| 209 | public: |
| 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 | |
| 221 | private: |
| 222 | }; |
| 223 | |
| 224 | //------------------------------------------------------------------------- |
| 225 | // CommandObjectBreakpointList |
| 226 | //------------------------------------------------------------------------- |
| 227 | |
| 228 | class CommandObjectBreakpointList : public CommandObject |
| 229 | { |
| 230 | public: |
| 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 | |
| 274 | private: |
| 275 | CommandOptions m_options; |
| 276 | }; |
| 277 | |
| 278 | //------------------------------------------------------------------------- |
| 279 | // CommandObjectBreakpointDelete |
| 280 | //------------------------------------------------------------------------- |
| 281 | |
| 282 | class CommandObjectBreakpointDelete : public CommandObject |
| 283 | { |
| 284 | public: |
| 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 | |
| 296 | private: |
| 297 | }; |
| 298 | |
| 299 | } // namespace lldb_private |
| 300 | |
| 301 | #endif // liblldb_CommandObjectBreakpoint_h_ |