blob: 703d51c8483dc7f007ef5cb7af2de23480784b05 [file] [log] [blame]
Jim Ingham35e1bda2012-10-16 21:41:58 +00001//===-- SWIG interface for SBExpressionOptions -----------------------------------------------*- 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
10namespace lldb {
11
12%feature("docstring",
13"A container for options to use when evaluating expressions."
14) SBExpressionOptions;
15
16class SBExpressionOptions
17{
18friend class SBFrame;
19friend class SBValue;
20
21public:
22 SBExpressionOptions();
23
24 SBExpressionOptions (const lldb::SBExpressionOptions &rhs);
25
Jim Ingham35e1bda2012-10-16 21:41:58 +000026 ~SBExpressionOptions();
27
28 bool
Greg Claytoncced1562012-10-16 22:58:25 +000029 GetCoerceResultToId () const;
Jim Ingham35e1bda2012-10-16 21:41:58 +000030
Greg Claytoncced1562012-10-16 22:58:25 +000031 %feature("docstring", "Sets whether to coerce the expression result to ObjC id type after evaluation.") SetCoerceResultToId;
32
Jim Ingham35e1bda2012-10-16 21:41:58 +000033 void
Greg Claytoncced1562012-10-16 22:58:25 +000034 SetCoerceResultToId (bool coerce = true);
Jim Ingham35e1bda2012-10-16 21:41:58 +000035
36 bool
Greg Claytoncced1562012-10-16 22:58:25 +000037 GetUnwindOnError () const;
Jim Ingham35e1bda2012-10-16 21:41:58 +000038
Greg Claytoncced1562012-10-16 22:58:25 +000039 %feature("docstring", "Sets whether to unwind the expression stack on error.") SetUnwindOnError;
40
Jim Ingham35e1bda2012-10-16 21:41:58 +000041 void
Jim Ingham0161b492013-02-09 01:29:05 +000042 SetUnwindOnError (bool unwind = true);
Jim Ingham35e1bda2012-10-16 21:41:58 +000043
Jim Ingham184e9812013-01-15 02:47:48 +000044 bool
45 GetIgnoreBreakpoints () const;
46
47 %feature("docstring", "Sets whether to ignore breakpoint hits while running expressions.") SetUnwindOnError;
48
49 void
Jim Ingham0161b492013-02-09 01:29:05 +000050 SetIgnoreBreakpoints (bool ignore = true);
Jim Ingham184e9812013-01-15 02:47:48 +000051
Jim Ingham35e1bda2012-10-16 21:41:58 +000052 lldb::DynamicValueType
Greg Claytoncced1562012-10-16 22:58:25 +000053 GetFetchDynamicValue () const;
Jim Ingham35e1bda2012-10-16 21:41:58 +000054
Greg Claytoncced1562012-10-16 22:58:25 +000055 %feature("docstring", "Sets whether to cast the expression result to its dynamic type.") SetFetchDynamicValue;
56
Jim Ingham35e1bda2012-10-16 21:41:58 +000057 void
Greg Claytoncced1562012-10-16 22:58:25 +000058 SetFetchDynamicValue (lldb::DynamicValueType dynamic = lldb::eDynamicCanRunTarget);
59
Jim Ingham35e1bda2012-10-16 21:41:58 +000060 uint32_t
Greg Claytoncced1562012-10-16 22:58:25 +000061 GetTimeoutInMicroSeconds () const;
Jim Ingham35e1bda2012-10-16 21:41:58 +000062
Greg Claytoncced1562012-10-16 22:58:25 +000063 %feature("docstring", "Sets the timeout in microseconds to run the expression for. If try all threads is set to true and the expression doesn't complete within the specified timeout, all threads will be resumed for the same timeout to see if the expresson will finish.") SetTimeoutInMicroSeconds;
Jim Ingham35e1bda2012-10-16 21:41:58 +000064 void
Greg Claytoncced1562012-10-16 22:58:25 +000065 SetTimeoutInMicroSeconds (uint32_t timeout = 0);
Jim Ingham35e1bda2012-10-16 21:41:58 +000066
67 bool
Greg Claytoncced1562012-10-16 22:58:25 +000068 GetTryAllThreads () const;
Jim Ingham35e1bda2012-10-16 21:41:58 +000069
Greg Claytoncced1562012-10-16 22:58:25 +000070 %feature("docstring", "Sets whether to run all threads if the expression does not complete on one thread.") SetTryAllThreads;
Jim Ingham35e1bda2012-10-16 21:41:58 +000071 void
Greg Claytoncced1562012-10-16 22:58:25 +000072 SetTryAllThreads (bool run_others = true);
73
Jim Ingham35e1bda2012-10-16 21:41:58 +000074protected:
75
76 SBExpressionOptions (lldb_private::EvaluateExpressionOptions &expression_options);
77
78 lldb_private::EvaluateExpressionOptions *
79 get () const;
80
81 lldb_private::EvaluateExpressionOptions &
82 ref () const;
83
84private:
85 // This auto_pointer is made in the constructor and is always valid.
Greg Clayton7b0992d2013-04-18 22:45:39 +000086 mutable std::unique_ptr<lldb_private::EvaluateExpressionOptions> m_opaque_ap;
Jim Ingham35e1bda2012-10-16 21:41:58 +000087};
88
89} // namespace lldb