1 //===-- CommandObjectExpression.h -------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef liblldb_CommandObjectExpression_h_
10 #define liblldb_CommandObjectExpression_h_
12 #include "lldb/Core/IOHandler.h"
13 #include "lldb/Interpreter/CommandObject.h"
14 #include "lldb/Interpreter/OptionGroupBoolean.h"
15 #include "lldb/Interpreter/OptionGroupFormat.h"
16 #include "lldb/Interpreter/OptionGroupValueObjectDisplay.h"
17 #include "lldb/lldb-private-enumerations.h"
18 namespace lldb_private
{
20 class CommandObjectExpression
: public CommandObjectRaw
,
21 public IOHandlerDelegate
{
23 class CommandOptions
: public OptionGroup
{
27 ~CommandOptions() override
;
29 llvm::ArrayRef
<OptionDefinition
> GetDefinitions() override
;
31 Status
SetOptionValue(uint32_t option_idx
, llvm::StringRef option_value
,
32 ExecutionContext
*execution_context
) override
;
34 void OptionParsingStarting(ExecutionContext
*execution_context
) override
;
38 bool ignore_breakpoints
;
45 lldb::LanguageType language
;
46 LanguageRuntimeDescriptionDisplayVerbosity m_verbosity
;
47 LazyBool auto_apply_fixits
;
50 CommandObjectExpression(CommandInterpreter
&interpreter
);
52 ~CommandObjectExpression() override
;
54 Options
*GetOptions() override
;
56 void HandleCompletion(CompletionRequest
&request
) override
;
59 // IOHandler::Delegate functions
60 void IOHandlerInputComplete(IOHandler
&io_handler
,
61 std::string
&line
) override
;
63 bool IOHandlerIsInputComplete(IOHandler
&io_handler
,
64 StringList
&lines
) override
;
66 bool DoExecute(llvm::StringRef command
, CommandReturnObject
&result
) override
;
68 bool EvaluateExpression(llvm::StringRef expr
, Stream
*output_stream
,
70 CommandReturnObject
*result
= nullptr);
72 void GetMultilineExpression();
74 OptionGroupOptions m_option_group
;
75 OptionGroupFormat m_format_options
;
76 OptionGroupValueObjectDisplay m_varobj_options
;
77 OptionGroupBoolean m_repl_option
;
78 CommandOptions m_command_options
;
79 uint32_t m_expr_line_count
;
80 std::string m_expr_lines
; // Multi-line expression support
81 std::string m_fixed_expression
; // Holds the current expression's fixed text.
84 } // namespace lldb_private
86 #endif // liblldb_CommandObjectExpression_h_