blob: 6ee3e3b64faf575577c9e9c74d9c988586f2c052 [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
Jim Ingham914f4e72014-03-28 21:58:28 +000067 uint32_t
68 GetOneThreadTimeoutInMicroSeconds () const;
69
70 %feature("docstring", "Sets the timeout in microseconds to run the expression on one thread before either timing out or trying all threads.") SetTimeoutInMicroSeconds;
71 void
72 SetOneThreadTimeoutInMicroSeconds (uint32_t timeout = 0);
73
Jim Ingham35e1bda2012-10-16 21:41:58 +000074 bool
Greg Claytoncced1562012-10-16 22:58:25 +000075 GetTryAllThreads () const;
Jim Ingham35e1bda2012-10-16 21:41:58 +000076
Greg Claytoncced1562012-10-16 22:58:25 +000077 %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 +000078 void
Greg Claytoncced1562012-10-16 22:58:25 +000079 SetTryAllThreads (bool run_others = true);
80
Jim Ingham6fbc48b2013-11-07 00:11:47 +000081 bool
Jim Ingham286fb1e2014-02-28 02:52:06 +000082 GetStopOthers () const;
83
84 %feature("docstring", "Sets whether to stop other threads at all while running expressins. If false, TryAllThreads does nothing.") SetTryAllThreads;
85 void
86 SetStopOthers (bool stop_others = true);
87
88 bool
Jim Ingham6fbc48b2013-11-07 00:11:47 +000089 GetTrapExceptions () const;
90
91 %feature("docstring", "Sets whether to abort expression evaluation if an exception is thrown while executing. Don't set this to false unless you know the function you are calling traps all exceptions itself.") SetTryAllThreads;
92 void
93 SetTrapExceptions (bool trap_exceptions = true);
94
Jason Molenda705b1802014-06-13 02:37:02 +000095 %feature ("docstring", "Sets the language that LLDB should assume the expression is written in") SetLanguage;
96 void
97 SetLanguage (lldb::LanguageType language);
Greg Clayton205ca1e2014-07-11 01:03:57 +000098
99 bool
100 GetGenerateDebugInfo ();
101
102 %feature("docstring", "Sets whether to generate debug information for the expression and also controls if a SBModule is generated.") SetGenerateDebugInfo;
103 void
104 SetGenerateDebugInfo (bool b = true);
Jim Ingham7ab079b2014-08-08 21:45:36 +0000105
106 bool
107 GetSuppressPersistentResult ();
108
109 %feature("docstring", "Sets whether to produce a persistent result that can be used in future expressions.") SetSuppressPersistentResult;
110 void
111 SetSuppressPersistentResult (bool b = false);
112
113
Greg Clayton205ca1e2014-07-11 01:03:57 +0000114
Jim Ingham35e1bda2012-10-16 21:41:58 +0000115protected:
116
117 SBExpressionOptions (lldb_private::EvaluateExpressionOptions &expression_options);
118
119 lldb_private::EvaluateExpressionOptions *
120 get () const;
121
122 lldb_private::EvaluateExpressionOptions &
123 ref () const;
124
125private:
126 // This auto_pointer is made in the constructor and is always valid.
Greg Clayton7b0992d2013-04-18 22:45:39 +0000127 mutable std::unique_ptr<lldb_private::EvaluateExpressionOptions> m_opaque_ap;
Jim Ingham35e1bda2012-10-16 21:41:58 +0000128};
129
130} // namespace lldb