blob: e0703a22a4cc3d3b60c7d05abead1ceb13762cd6 [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
17#include "lldb/Interpreter/CommandObject.h"
Greg Clayton1deb7962011-10-25 06:44:01 +000018#include "lldb/Interpreter/OptionGroupFormat.h"
Enrico Granatab576bba2013-01-09 20:12:53 +000019#include "lldb/Interpreter/OptionGroupValueObjectDisplay.h"
Chris Lattner30fdc8d2010-06-08 16:52:24 +000020#include "lldb/Target/ExecutionContext.h"
21
22namespace lldb_private {
23
Jim Ingham5a988412012-06-08 21:56:10 +000024class CommandObjectExpression : public CommandObjectRaw
Chris Lattner30fdc8d2010-06-08 16:52:24 +000025{
26public:
27
Greg Clayton1deb7962011-10-25 06:44:01 +000028 class CommandOptions : public OptionGroup
Chris Lattner30fdc8d2010-06-08 16:52:24 +000029 {
30 public:
31
Greg Clayton1deb7962011-10-25 06:44:01 +000032 CommandOptions ();
Chris Lattner30fdc8d2010-06-08 16:52:24 +000033
34 virtual
35 ~CommandOptions ();
36
Greg Clayton1deb7962011-10-25 06:44:01 +000037 virtual uint32_t
38 GetNumDefinitions ();
39
40 virtual const OptionDefinition*
Chris Lattner30fdc8d2010-06-08 16:52:24 +000041 GetDefinitions ();
Greg Clayton1deb7962011-10-25 06:44:01 +000042
43 virtual Error
44 SetOptionValue (CommandInterpreter &interpreter,
45 uint32_t option_idx,
46 const char *option_value);
47
48 virtual void
49 OptionParsingStarting (CommandInterpreter &interpreter);
Chris Lattner30fdc8d2010-06-08 16:52:24 +000050
51 // Options table: Required for subclasses of Options.
52
Greg Claytone0d378b2011-03-24 21:19:54 +000053 static OptionDefinition g_option_table[];
Jim Ingham399f1ca2010-11-05 19:25:48 +000054 bool unwind_on_error;
Jim Ingham184e9812013-01-15 02:47:48 +000055 bool ignore_breakpoints;
Chris Lattner30fdc8d2010-06-08 16:52:24 +000056 bool show_types;
57 bool show_summary;
Greg Clayton62afb9f2013-11-04 19:35:17 +000058 bool debug;
Jim Ingham35e1bda2012-10-16 21:41:58 +000059 uint32_t timeout;
60 bool try_all_threads;
Enrico Granata4d93b8c2013-09-30 19:11:51 +000061 LanguageRuntimeDescriptionDisplayVerbosity m_verbosity;
Chris Lattner30fdc8d2010-06-08 16:52:24 +000062 };
63
Greg Claytona7015092010-09-18 01:14:36 +000064 CommandObjectExpression (CommandInterpreter &interpreter);
Chris Lattner30fdc8d2010-06-08 16:52:24 +000065
66 virtual
67 ~CommandObjectExpression ();
68
69 virtual
70 Options *
71 GetOptions ();
72
Chris Lattner30fdc8d2010-06-08 16:52:24 +000073protected:
Jim Ingham5a988412012-06-08 21:56:10 +000074 virtual bool
75 DoExecute (const char *command,
76 CommandReturnObject &result);
Chris Lattner30fdc8d2010-06-08 16:52:24 +000077
78 static size_t
79 MultiLineExpressionCallback (void *baton,
Greg Clayton66111032010-06-23 01:19:29 +000080 InputReader &reader,
Chris Lattner30fdc8d2010-06-08 16:52:24 +000081 lldb::InputReaderAction notification,
82 const char *bytes,
83 size_t bytes_len);
84
85 bool
Johnny Chenfcd43b72010-08-13 00:42:30 +000086 EvaluateExpression (const char *expr,
Caroline Tice6e8dc332011-06-13 20:20:29 +000087 Stream *output_stream,
88 Stream *error_stream,
Johnny Chenfcd43b72010-08-13 00:42:30 +000089 CommandReturnObject *result = NULL);
Chris Lattner30fdc8d2010-06-08 16:52:24 +000090
Greg Clayton1deb7962011-10-25 06:44:01 +000091 OptionGroupOptions m_option_group;
92 OptionGroupFormat m_format_options;
Enrico Granatab576bba2013-01-09 20:12:53 +000093 OptionGroupValueObjectDisplay m_varobj_options;
Greg Clayton1deb7962011-10-25 06:44:01 +000094 CommandOptions m_command_options;
Chris Lattner30fdc8d2010-06-08 16:52:24 +000095 uint32_t m_expr_line_count;
96 std::string m_expr_lines; // Multi-line expression support
97};
98
99} // namespace lldb_private
100
101#endif // liblldb_CommandObjectExpression_h_