blob: 4b5162fc67fc27027e8b8df491cb7ab5500bef8e [file] [log] [blame]
Chris Lattner30fdc8d2010-06-08 16:52:24 +00001//===-- 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
Greg Clayton44d93782014-01-27 23:43:24 +000017#include "lldb/Core/IOHandler.h"
Chris Lattner30fdc8d2010-06-08 16:52:24 +000018#include "lldb/Interpreter/CommandObject.h"
Greg Clayton1deb7962011-10-25 06:44:01 +000019#include "lldb/Interpreter/OptionGroupFormat.h"
Enrico Granatab576bba2013-01-09 20:12:53 +000020#include "lldb/Interpreter/OptionGroupValueObjectDisplay.h"
Chris Lattner30fdc8d2010-06-08 16:52:24 +000021#include "lldb/Target/ExecutionContext.h"
22
23namespace lldb_private {
24
Greg Clayton44d93782014-01-27 23:43:24 +000025class CommandObjectExpression :
26 public CommandObjectRaw,
27 public IOHandlerDelegate
Chris Lattner30fdc8d2010-06-08 16:52:24 +000028{
29public:
30
Greg Clayton1deb7962011-10-25 06:44:01 +000031 class CommandOptions : public OptionGroup
Chris Lattner30fdc8d2010-06-08 16:52:24 +000032 {
33 public:
34
Greg Clayton1deb7962011-10-25 06:44:01 +000035 CommandOptions ();
Chris Lattner30fdc8d2010-06-08 16:52:24 +000036
37 virtual
38 ~CommandOptions ();
39
Greg Clayton1deb7962011-10-25 06:44:01 +000040 virtual uint32_t
41 GetNumDefinitions ();
42
43 virtual const OptionDefinition*
Chris Lattner30fdc8d2010-06-08 16:52:24 +000044 GetDefinitions ();
Greg Clayton1deb7962011-10-25 06:44:01 +000045
46 virtual Error
47 SetOptionValue (CommandInterpreter &interpreter,
48 uint32_t option_idx,
49 const char *option_value);
50
51 virtual void
52 OptionParsingStarting (CommandInterpreter &interpreter);
Chris Lattner30fdc8d2010-06-08 16:52:24 +000053
54 // Options table: Required for subclasses of Options.
55
Greg Claytone0d378b2011-03-24 21:19:54 +000056 static OptionDefinition g_option_table[];
Jim Ingham399f1ca2010-11-05 19:25:48 +000057 bool unwind_on_error;
Jim Ingham184e9812013-01-15 02:47:48 +000058 bool ignore_breakpoints;
Chris Lattner30fdc8d2010-06-08 16:52:24 +000059 bool show_types;
60 bool show_summary;
Greg Clayton62afb9f2013-11-04 19:35:17 +000061 bool debug;
Jim Ingham35e1bda2012-10-16 21:41:58 +000062 uint32_t timeout;
63 bool try_all_threads;
Enrico Granata4d93b8c2013-09-30 19:11:51 +000064 LanguageRuntimeDescriptionDisplayVerbosity m_verbosity;
Chris Lattner30fdc8d2010-06-08 16:52:24 +000065 };
66
Greg Claytona7015092010-09-18 01:14:36 +000067 CommandObjectExpression (CommandInterpreter &interpreter);
Chris Lattner30fdc8d2010-06-08 16:52:24 +000068
69 virtual
70 ~CommandObjectExpression ();
71
72 virtual
73 Options *
74 GetOptions ();
75
Chris Lattner30fdc8d2010-06-08 16:52:24 +000076protected:
Greg Clayton44d93782014-01-27 23:43:24 +000077
78 //------------------------------------------------------------------
79 // IOHandler::Delegate functions
80 //------------------------------------------------------------------
81 virtual void
82 IOHandlerActivated (IOHandler &io_handler);
83
84 virtual void
85 IOHandlerInputComplete (IOHandler &io_handler,
86 std::string &line);
87
88 virtual LineStatus
89 IOHandlerLinesUpdated (IOHandler &io_handler,
90 StringList &lines,
91 uint32_t line_idx,
92 Error &error);
Jim Ingham5a988412012-06-08 21:56:10 +000093 virtual bool
94 DoExecute (const char *command,
95 CommandReturnObject &result);
Chris Lattner30fdc8d2010-06-08 16:52:24 +000096
Chris Lattner30fdc8d2010-06-08 16:52:24 +000097 bool
Johnny Chenfcd43b72010-08-13 00:42:30 +000098 EvaluateExpression (const char *expr,
Caroline Tice6e8dc332011-06-13 20:20:29 +000099 Stream *output_stream,
100 Stream *error_stream,
Johnny Chenfcd43b72010-08-13 00:42:30 +0000101 CommandReturnObject *result = NULL);
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000102
Greg Clayton1deb7962011-10-25 06:44:01 +0000103 OptionGroupOptions m_option_group;
104 OptionGroupFormat m_format_options;
Enrico Granatab576bba2013-01-09 20:12:53 +0000105 OptionGroupValueObjectDisplay m_varobj_options;
Greg Clayton1deb7962011-10-25 06:44:01 +0000106 CommandOptions m_command_options;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000107 uint32_t m_expr_line_count;
108 std::string m_expr_lines; // Multi-line expression support
109};
110
111} // namespace lldb_private
112
113#endif // liblldb_CommandObjectExpression_h_