blob: 3964f2d423eb72dab5813e571288c9baa2bd901f [file] [log] [blame]
Chris Lattner24943d22010-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 Claytona42880a2011-10-25 06:44:01 +000018#include "lldb/Interpreter/OptionGroupFormat.h"
Enrico Granata3a91e142013-01-09 20:12:53 +000019#include "lldb/Interpreter/OptionGroupValueObjectDisplay.h"
Chris Lattner24943d22010-06-08 16:52:24 +000020#include "lldb/Target/ExecutionContext.h"
21
22namespace lldb_private {
23
Jim Inghamda26bd22012-06-08 21:56:10 +000024class CommandObjectExpression : public CommandObjectRaw
Chris Lattner24943d22010-06-08 16:52:24 +000025{
26public:
27
Greg Claytona42880a2011-10-25 06:44:01 +000028 class CommandOptions : public OptionGroup
Chris Lattner24943d22010-06-08 16:52:24 +000029 {
30 public:
31
Greg Claytona42880a2011-10-25 06:44:01 +000032 CommandOptions ();
Chris Lattner24943d22010-06-08 16:52:24 +000033
34 virtual
35 ~CommandOptions ();
36
Greg Claytona42880a2011-10-25 06:44:01 +000037 virtual uint32_t
38 GetNumDefinitions ();
39
40 virtual const OptionDefinition*
Chris Lattner24943d22010-06-08 16:52:24 +000041 GetDefinitions ();
Greg Claytona42880a2011-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 Lattner24943d22010-06-08 16:52:24 +000050
51 // Options table: Required for subclasses of Options.
52
Greg Claytonb3448432011-03-24 21:19:54 +000053 static OptionDefinition g_option_table[];
Jim Inghamea9d4262010-11-05 19:25:48 +000054 bool unwind_on_error;
Jim Inghamb7940202013-01-15 02:47:48 +000055 bool ignore_breakpoints;
Chris Lattner24943d22010-06-08 16:52:24 +000056 bool show_types;
57 bool show_summary;
Jim Ingham47beabb2012-10-16 21:41:58 +000058 uint32_t timeout;
59 bool try_all_threads;
Chris Lattner24943d22010-06-08 16:52:24 +000060 };
61
Greg Clayton238c0a12010-09-18 01:14:36 +000062 CommandObjectExpression (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +000063
64 virtual
65 ~CommandObjectExpression ();
66
67 virtual
68 Options *
69 GetOptions ();
70
Chris Lattner24943d22010-06-08 16:52:24 +000071protected:
Jim Inghamda26bd22012-06-08 21:56:10 +000072 virtual bool
73 DoExecute (const char *command,
74 CommandReturnObject &result);
Chris Lattner24943d22010-06-08 16:52:24 +000075
76 static size_t
77 MultiLineExpressionCallback (void *baton,
Greg Clayton63094e02010-06-23 01:19:29 +000078 InputReader &reader,
Chris Lattner24943d22010-06-08 16:52:24 +000079 lldb::InputReaderAction notification,
80 const char *bytes,
81 size_t bytes_len);
82
83 bool
Johnny Chen0deefc72010-08-13 00:42:30 +000084 EvaluateExpression (const char *expr,
Caroline Tice87e1f772011-06-13 20:20:29 +000085 Stream *output_stream,
86 Stream *error_stream,
Johnny Chen0deefc72010-08-13 00:42:30 +000087 CommandReturnObject *result = NULL);
Chris Lattner24943d22010-06-08 16:52:24 +000088
Greg Claytona42880a2011-10-25 06:44:01 +000089 OptionGroupOptions m_option_group;
90 OptionGroupFormat m_format_options;
Enrico Granata3a91e142013-01-09 20:12:53 +000091 OptionGroupValueObjectDisplay m_varobj_options;
Greg Claytona42880a2011-10-25 06:44:01 +000092 CommandOptions m_command_options;
Chris Lattner24943d22010-06-08 16:52:24 +000093 uint32_t m_expr_line_count;
94 std::string m_expr_lines; // Multi-line expression support
95};
96
97} // namespace lldb_private
98
99#endif // liblldb_CommandObjectExpression_h_