1254721Semaste//===-- CommandObjectExpression.h -------------------------------*- C++ -*-===//
2254721Semaste//
3254721Semaste//                     The LLVM Compiler Infrastructure
4254721Semaste//
5254721Semaste// This file is distributed under the University of Illinois Open Source
6254721Semaste// License. See LICENSE.TXT for details.
7254721Semaste//
8254721Semaste//===----------------------------------------------------------------------===//
9254721Semaste
10254721Semaste#ifndef liblldb_CommandObjectExpression_h_
11254721Semaste#define liblldb_CommandObjectExpression_h_
12254721Semaste
13254721Semaste// C Includes
14254721Semaste// C++ Includes
15254721Semaste// Other libraries and framework includes
16254721Semaste// Project includes
17269024Semaste#include "lldb/Core/IOHandler.h"
18254721Semaste#include "lldb/Interpreter/CommandObject.h"
19254721Semaste#include "lldb/Interpreter/OptionGroupFormat.h"
20254721Semaste#include "lldb/Interpreter/OptionGroupValueObjectDisplay.h"
21254721Semaste#include "lldb/Target/ExecutionContext.h"
22254721Semaste
23254721Semastenamespace lldb_private {
24254721Semaste
25269024Semasteclass CommandObjectExpression :
26269024Semaste    public CommandObjectRaw,
27269024Semaste    public IOHandlerDelegate
28254721Semaste{
29254721Semastepublic:
30254721Semaste
31254721Semaste    class CommandOptions : public OptionGroup
32254721Semaste    {
33254721Semaste    public:
34254721Semaste
35254721Semaste        CommandOptions ();
36254721Semaste
37254721Semaste        virtual
38254721Semaste        ~CommandOptions ();
39254721Semaste
40254721Semaste        virtual uint32_t
41254721Semaste        GetNumDefinitions ();
42254721Semaste
43254721Semaste        virtual const OptionDefinition*
44254721Semaste        GetDefinitions ();
45254721Semaste
46254721Semaste        virtual Error
47254721Semaste        SetOptionValue (CommandInterpreter &interpreter,
48254721Semaste                        uint32_t option_idx,
49254721Semaste                        const char *option_value);
50254721Semaste
51254721Semaste        virtual void
52254721Semaste        OptionParsingStarting (CommandInterpreter &interpreter);
53254721Semaste
54254721Semaste        // Options table: Required for subclasses of Options.
55254721Semaste
56254721Semaste        static OptionDefinition g_option_table[];
57254721Semaste        bool        unwind_on_error;
58254721Semaste        bool        ignore_breakpoints;
59254721Semaste        bool        show_types;
60254721Semaste        bool        show_summary;
61263363Semaste        bool        debug;
62254721Semaste        uint32_t    timeout;
63254721Semaste        bool        try_all_threads;
64263363Semaste        LanguageRuntimeDescriptionDisplayVerbosity m_verbosity;
65254721Semaste    };
66254721Semaste
67254721Semaste    CommandObjectExpression (CommandInterpreter &interpreter);
68254721Semaste
69254721Semaste    virtual
70254721Semaste    ~CommandObjectExpression ();
71254721Semaste
72254721Semaste    virtual
73254721Semaste    Options *
74254721Semaste    GetOptions ();
75254721Semaste
76254721Semasteprotected:
77269024Semaste
78269024Semaste    //------------------------------------------------------------------
79269024Semaste    // IOHandler::Delegate functions
80269024Semaste    //------------------------------------------------------------------
81269024Semaste    virtual void
82269024Semaste    IOHandlerInputComplete (IOHandler &io_handler,
83269024Semaste                            std::string &line);
84269024Semaste
85269024Semaste    virtual LineStatus
86269024Semaste    IOHandlerLinesUpdated (IOHandler &io_handler,
87269024Semaste                           StringList &lines,
88269024Semaste                           uint32_t line_idx,
89269024Semaste                           Error &error);
90254721Semaste    virtual bool
91254721Semaste    DoExecute (const char *command,
92254721Semaste               CommandReturnObject &result);
93254721Semaste
94254721Semaste    bool
95254721Semaste    EvaluateExpression (const char *expr,
96254721Semaste                        Stream *output_stream,
97254721Semaste                        Stream *error_stream,
98254721Semaste                        CommandReturnObject *result = NULL);
99254721Semaste
100254721Semaste    OptionGroupOptions m_option_group;
101254721Semaste    OptionGroupFormat m_format_options;
102254721Semaste    OptionGroupValueObjectDisplay m_varobj_options;
103254721Semaste    CommandOptions m_command_options;
104254721Semaste    uint32_t m_expr_line_count;
105254721Semaste    std::string m_expr_lines; // Multi-line expression support
106254721Semaste};
107254721Semaste
108254721Semaste} // namespace lldb_private
109254721Semaste
110254721Semaste#endif  // liblldb_CommandObjectExpression_h_
111