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_
13 #include "lldb/Core/IOHandler.h"
14 #include "lldb/Interpreter/CommandObject.h"
15 #include "lldb/Interpreter/OptionGroupBoolean.h"
16 #include "lldb/Interpreter/OptionGroupFormat.h"
17 #include "lldb/Interpreter/OptionGroupValueObjectDisplay.h"
18 #include "lldb/Target/ExecutionContext.h"
19 #include "lldb/lldb-private-enumerations.h"
20 namespace lldb_private {
22 class CommandObjectExpression : public CommandObjectRaw,
23 public IOHandlerDelegate {
25 class CommandOptions : public OptionGroup {
29 ~CommandOptions() override;
31 llvm::ArrayRef<OptionDefinition> GetDefinitions() override;
33 Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value,
34 ExecutionContext *execution_context) override;
36 void OptionParsingStarting(ExecutionContext *execution_context) override;
40 bool ignore_breakpoints;
47 lldb::LanguageType language;
48 LanguageRuntimeDescriptionDisplayVerbosity m_verbosity;
49 LazyBool auto_apply_fixits;
52 CommandObjectExpression(CommandInterpreter &interpreter);
54 ~CommandObjectExpression() override;
56 Options *GetOptions() override;
58 int HandleCompletion(CompletionRequest &request) override;
61 //------------------------------------------------------------------
62 // IOHandler::Delegate functions
63 //------------------------------------------------------------------
64 void IOHandlerInputComplete(IOHandler &io_handler,
65 std::string &line) override;
67 bool IOHandlerIsInputComplete(IOHandler &io_handler,
68 StringList &lines) override;
70 bool DoExecute(llvm::StringRef command, CommandReturnObject &result) override;
72 bool EvaluateExpression(llvm::StringRef expr, Stream *output_stream,
74 CommandReturnObject *result = NULL);
76 void GetMultilineExpression();
78 OptionGroupOptions m_option_group;
79 OptionGroupFormat m_format_options;
80 OptionGroupValueObjectDisplay m_varobj_options;
81 OptionGroupBoolean m_repl_option;
82 CommandOptions m_command_options;
83 uint32_t m_expr_line_count;
84 std::string m_expr_lines; // Multi-line expression support
85 std::string m_fixed_expression; // Holds the current expression's fixed text.
88 } // namespace lldb_private
90 #endif // liblldb_CommandObjectExpression_h_