Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 1 | //===-- CommandObjectBreakpointCommand.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_CommandObjectBreakpointCommand_h_ |
| 11 | #define liblldb_CommandObjectBreakpointCommand_h_ |
| 12 | |
| 13 | // C Includes |
| 14 | // C++ Includes |
| 15 | |
| 16 | |
| 17 | // Other libraries and framework includes |
| 18 | // Project includes |
| 19 | |
| 20 | #include "lldb/lldb-types.h" |
Jim Ingham | 84cdc15 | 2010-06-15 19:49:27 +0000 | [diff] [blame] | 21 | #include "lldb/Interpreter/Options.h" |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 22 | #include "lldb/Core/InputReader.h" |
| 23 | #include "lldb/Interpreter/CommandObject.h" |
| 24 | #include "lldb/Interpreter/CommandReturnObject.h" |
| 25 | #include "lldb/Interpreter/CommandObjectMultiword.h" |
| 26 | |
| 27 | |
| 28 | namespace lldb_private { |
| 29 | |
| 30 | //------------------------------------------------------------------------- |
| 31 | // CommandObjectMultiwordBreakpoint |
| 32 | //------------------------------------------------------------------------- |
| 33 | |
| 34 | class CommandObjectBreakpointCommand : public CommandObjectMultiword |
| 35 | { |
| 36 | public: |
Greg Clayton | 63094e0 | 2010-06-23 01:19:29 +0000 | [diff] [blame] | 37 | CommandObjectBreakpointCommand (CommandInterpreter &interpreter); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 38 | |
| 39 | virtual |
| 40 | ~CommandObjectBreakpointCommand (); |
| 41 | |
| 42 | |
| 43 | static bool |
| 44 | BreakpointOptionsCallbackFunction (void *baton, |
| 45 | StoppointCallbackContext *context, |
| 46 | lldb::user_id_t break_id, |
| 47 | lldb::user_id_t break_loc_id); |
| 48 | }; |
| 49 | |
| 50 | //------------------------------------------------------------------------- |
| 51 | // CommandObjectBreakpointCommandAdd |
| 52 | //------------------------------------------------------------------------- |
| 53 | |
| 54 | |
| 55 | class CommandObjectBreakpointCommandAdd : public CommandObject |
| 56 | { |
| 57 | public: |
| 58 | |
| 59 | CommandObjectBreakpointCommandAdd (); |
| 60 | |
| 61 | virtual |
| 62 | ~CommandObjectBreakpointCommandAdd (); |
| 63 | |
| 64 | virtual bool |
Greg Clayton | 63094e0 | 2010-06-23 01:19:29 +0000 | [diff] [blame] | 65 | Execute (CommandInterpreter &interpreter, |
| 66 | Args& command, |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 67 | CommandReturnObject &result); |
| 68 | |
| 69 | virtual Options * |
| 70 | GetOptions (); |
| 71 | |
| 72 | void |
Greg Clayton | 63094e0 | 2010-06-23 01:19:29 +0000 | [diff] [blame] | 73 | CollectDataForBreakpointCommandCallback (CommandInterpreter &interpreter, |
| 74 | BreakpointOptions *bp_options, |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 75 | CommandReturnObject &result); |
| 76 | |
Johnny Chen | b81ed0d | 2010-09-11 00:18:09 +0000 | [diff] [blame^] | 77 | void |
| 78 | SetBreakpointCommandCallback (CommandInterpreter &interpreter, |
| 79 | BreakpointOptions *bp_options, |
| 80 | const char *oneliner); |
| 81 | |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 82 | static size_t |
| 83 | GenerateBreakpointCommandCallback (void *baton, |
Greg Clayton | 63094e0 | 2010-06-23 01:19:29 +0000 | [diff] [blame] | 84 | InputReader &reader, |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 85 | lldb::InputReaderAction notification, |
| 86 | const char *bytes, |
| 87 | size_t bytes_len); |
| 88 | |
| 89 | static bool |
| 90 | BreakpointOptionsCallbackFunction (void *baton, |
| 91 | StoppointCallbackContext *context, |
| 92 | lldb::user_id_t break_id, |
| 93 | lldb::user_id_t break_loc_id); |
| 94 | |
| 95 | |
| 96 | class CommandOptions : public Options |
| 97 | { |
| 98 | public: |
| 99 | |
| 100 | CommandOptions (); |
| 101 | |
| 102 | virtual |
| 103 | ~CommandOptions (); |
| 104 | |
| 105 | virtual Error |
| 106 | SetOptionValue (int option_idx, const char *option_arg); |
| 107 | |
| 108 | void |
| 109 | ResetOptionValues (); |
| 110 | |
| 111 | const lldb::OptionDefinition* |
| 112 | GetDefinitions (); |
| 113 | |
| 114 | // Options table: Required for subclasses of Options. |
| 115 | |
| 116 | static lldb::OptionDefinition g_option_table[]; |
| 117 | |
| 118 | // Instance variables to hold the values for command options. |
| 119 | |
| 120 | bool m_use_commands; |
| 121 | bool m_use_script_language; |
| 122 | lldb::ScriptLanguage m_script_language; |
Johnny Chen | b81ed0d | 2010-09-11 00:18:09 +0000 | [diff] [blame^] | 123 | |
| 124 | // Instance variables to hold the values for one_liner options. |
| 125 | bool m_use_one_liner; |
| 126 | std::string m_one_liner; |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 127 | }; |
| 128 | |
| 129 | private: |
| 130 | CommandOptions m_options; |
| 131 | }; |
| 132 | |
| 133 | //------------------------------------------------------------------------- |
| 134 | // CommandObjectBreakpointCommandRemove |
| 135 | //------------------------------------------------------------------------- |
| 136 | |
| 137 | class CommandObjectBreakpointCommandRemove : public CommandObject |
| 138 | { |
| 139 | public: |
| 140 | CommandObjectBreakpointCommandRemove (); |
| 141 | |
| 142 | virtual |
| 143 | ~CommandObjectBreakpointCommandRemove (); |
| 144 | |
| 145 | virtual bool |
Greg Clayton | 63094e0 | 2010-06-23 01:19:29 +0000 | [diff] [blame] | 146 | Execute (CommandInterpreter &interpreter, |
| 147 | Args& command, |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 148 | CommandReturnObject &result); |
| 149 | |
| 150 | private: |
| 151 | }; |
| 152 | |
| 153 | //------------------------------------------------------------------------- |
| 154 | // CommandObjectBreakpointCommandList |
| 155 | //------------------------------------------------------------------------- |
| 156 | |
| 157 | class CommandObjectBreakpointCommandList : public CommandObject |
| 158 | { |
| 159 | public: |
| 160 | CommandObjectBreakpointCommandList (); |
| 161 | |
| 162 | virtual |
| 163 | ~CommandObjectBreakpointCommandList (); |
| 164 | |
| 165 | virtual bool |
Greg Clayton | 63094e0 | 2010-06-23 01:19:29 +0000 | [diff] [blame] | 166 | Execute (CommandInterpreter &interpreter, |
| 167 | Args& command, |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 168 | CommandReturnObject &result); |
| 169 | |
| 170 | private: |
| 171 | }; |
| 172 | |
| 173 | |
| 174 | } // namespace lldb_private |
| 175 | |
| 176 | #endif // liblldb_CommandObjectBreakpointCommand_h_ |