blob: b10e20889ee000fc631e7d369417b958b4332f24 [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;
Chris Lattner30fdc8d2010-06-08 16:52:24 +000055 bool show_types;
56 bool show_summary;
Jim Ingham35e1bda2012-10-16 21:41:58 +000057 uint32_t timeout;
58 bool try_all_threads;
Chris Lattner30fdc8d2010-06-08 16:52:24 +000059 };
60
Greg Claytona7015092010-09-18 01:14:36 +000061 CommandObjectExpression (CommandInterpreter &interpreter);
Chris Lattner30fdc8d2010-06-08 16:52:24 +000062
63 virtual
64 ~CommandObjectExpression ();
65
66 virtual
67 Options *
68 GetOptions ();
69
Chris Lattner30fdc8d2010-06-08 16:52:24 +000070protected:
Jim Ingham5a988412012-06-08 21:56:10 +000071 virtual bool
72 DoExecute (const char *command,
73 CommandReturnObject &result);
Chris Lattner30fdc8d2010-06-08 16:52:24 +000074
75 static size_t
76 MultiLineExpressionCallback (void *baton,
Greg Clayton66111032010-06-23 01:19:29 +000077 InputReader &reader,
Chris Lattner30fdc8d2010-06-08 16:52:24 +000078 lldb::InputReaderAction notification,
79 const char *bytes,
80 size_t bytes_len);
81
82 bool
Johnny Chenfcd43b72010-08-13 00:42:30 +000083 EvaluateExpression (const char *expr,
Caroline Tice6e8dc332011-06-13 20:20:29 +000084 Stream *output_stream,
85 Stream *error_stream,
Johnny Chenfcd43b72010-08-13 00:42:30 +000086 CommandReturnObject *result = NULL);
Chris Lattner30fdc8d2010-06-08 16:52:24 +000087
Greg Clayton1deb7962011-10-25 06:44:01 +000088 OptionGroupOptions m_option_group;
89 OptionGroupFormat m_format_options;
Enrico Granatab576bba2013-01-09 20:12:53 +000090 OptionGroupValueObjectDisplay m_varobj_options;
Greg Clayton1deb7962011-10-25 06:44:01 +000091 CommandOptions m_command_options;
Chris Lattner30fdc8d2010-06-08 16:52:24 +000092 uint32_t m_expr_line_count;
93 std::string m_expr_lines; // Multi-line expression support
94};
95
96} // namespace lldb_private
97
98#endif // liblldb_CommandObjectExpression_h_