1 //===-- CommandObjectExpression.h -------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_CommandObjectExpression_h_
11 #define liblldb_CommandObjectExpression_h_
15 // Other libraries and framework 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 {
26 class CommandObjectExpression : public CommandObjectRaw,
27 public IOHandlerDelegate {
29 class CommandOptions : public OptionGroup {
33 ~CommandOptions() override;
35 llvm::ArrayRef<OptionDefinition> GetDefinitions() override;
37 Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value,
38 ExecutionContext *execution_context) override;
40 void OptionParsingStarting(ExecutionContext *execution_context) override;
42 // Options table: Required for subclasses of Options.
44 static OptionDefinition g_option_table[];
47 bool ignore_breakpoints;
54 lldb::LanguageType language;
55 LanguageRuntimeDescriptionDisplayVerbosity m_verbosity;
56 LazyBool auto_apply_fixits;
59 CommandObjectExpression(CommandInterpreter &interpreter);
61 ~CommandObjectExpression() override;
63 Options *GetOptions() override;
66 //------------------------------------------------------------------
67 // IOHandler::Delegate functions
68 //------------------------------------------------------------------
69 void IOHandlerInputComplete(IOHandler &io_handler,
70 std::string &line) override;
72 bool IOHandlerIsInputComplete(IOHandler &io_handler,
73 StringList &lines) override;
75 bool DoExecute(llvm::StringRef command, CommandReturnObject &result) override;
77 bool EvaluateExpression(llvm::StringRef expr, Stream *output_stream,
79 CommandReturnObject *result = NULL);
81 void GetMultilineExpression();
83 OptionGroupOptions m_option_group;
84 OptionGroupFormat m_format_options;
85 OptionGroupValueObjectDisplay m_varobj_options;
86 OptionGroupBoolean m_repl_option;
87 CommandOptions m_command_options;
88 uint32_t m_expr_line_count;
89 std::string m_expr_lines; // Multi-line expression support
90 std::string m_fixed_expression; // Holds the current expression's fixed text.
93 } // namespace lldb_private
95 #endif // liblldb_CommandObjectExpression_h_