1 //===-- CommandObjectExpression.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_CommandObjectExpression_h_ 11 #define liblldb_CommandObjectExpression_h_ 12 13 // C Includes 14 // C++ Includes 15 // Other libraries and framework includes 16 // Project includes 17 #include "lldb/lldb-private-enumerations.h" 18 #include "lldb/Core/IOHandler.h" 19 #include "lldb/Interpreter/CommandObject.h" 20 #include "lldb/Interpreter/OptionGroupBoolean.h" 21 #include "lldb/Interpreter/OptionGroupFormat.h" 22 #include "lldb/Interpreter/OptionGroupValueObjectDisplay.h" 23 #include "lldb/Target/ExecutionContext.h" 24 namespace lldb_private { 25 26 class CommandObjectExpression : 27 public CommandObjectRaw, 28 public IOHandlerDelegate 29 { 30 public: 31 32 class CommandOptions : public OptionGroup 33 { 34 public: 35 36 CommandOptions (); 37 38 ~CommandOptions() override; 39 40 uint32_t 41 GetNumDefinitions() override; 42 43 const OptionDefinition* 44 GetDefinitions() override; 45 46 Error 47 SetOptionValue(uint32_t option_idx, 48 const char *option_value, 49 ExecutionContext *execution_context) override; 50 51 void 52 OptionParsingStarting(ExecutionContext *execution_context) override; 53 54 // Options table: Required for subclasses of Options. 55 56 static OptionDefinition g_option_table[]; 57 bool top_level; 58 bool unwind_on_error; 59 bool ignore_breakpoints; 60 bool allow_jit; 61 bool show_types; 62 bool show_summary; 63 bool debug; 64 uint32_t timeout; 65 bool try_all_threads; 66 lldb::LanguageType language; 67 LanguageRuntimeDescriptionDisplayVerbosity m_verbosity; 68 LazyBool auto_apply_fixits; 69 }; 70 71 CommandObjectExpression (CommandInterpreter &interpreter); 72 73 ~CommandObjectExpression() override; 74 75 Options * 76 GetOptions() override; 77 78 protected: 79 80 //------------------------------------------------------------------ 81 // IOHandler::Delegate functions 82 //------------------------------------------------------------------ 83 void 84 IOHandlerInputComplete(IOHandler &io_handler, 85 std::string &line) override; 86 87 bool 88 IOHandlerIsInputComplete (IOHandler &io_handler, 89 StringList &lines) override; 90 91 bool 92 DoExecute(const char *command, 93 CommandReturnObject &result) override; 94 95 bool 96 EvaluateExpression (const char *expr, 97 Stream *output_stream, 98 Stream *error_stream, 99 CommandReturnObject *result = NULL); 100 101 void 102 GetMultilineExpression (); 103 104 OptionGroupOptions m_option_group; 105 OptionGroupFormat m_format_options; 106 OptionGroupValueObjectDisplay m_varobj_options; 107 OptionGroupBoolean m_repl_option; 108 CommandOptions m_command_options; 109 uint32_t m_expr_line_count; 110 std::string m_expr_lines; // Multi-line expression support 111 std::string m_fixed_expression; // Holds the current expression's fixed text. 112 }; 113 114 } // namespace lldb_private 115 116 #endif // liblldb_CommandObjectExpression_h_ 117