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