blob: 319040281c1f5db82371a910b0a871c54fb312c9 [file] [log] [blame]
Jim Ingham47beabb2012-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 Ingham47beabb2012-10-16 21:41:58 +000026 ~SBExpressionOptions();
27
28 bool
Greg Clayton75a443b2012-10-16 22:58:25 +000029 GetCoerceResultToId () const;
Jim Ingham47beabb2012-10-16 21:41:58 +000030
Greg Clayton75a443b2012-10-16 22:58:25 +000031 %feature("docstring", "Sets whether to coerce the expression result to ObjC id type after evaluation.") SetCoerceResultToId;
32
Jim Ingham47beabb2012-10-16 21:41:58 +000033 void
Greg Clayton75a443b2012-10-16 22:58:25 +000034 SetCoerceResultToId (bool coerce = true);
Jim Ingham47beabb2012-10-16 21:41:58 +000035
36 bool
Greg Clayton75a443b2012-10-16 22:58:25 +000037 GetUnwindOnError () const;
Jim Ingham47beabb2012-10-16 21:41:58 +000038
Greg Clayton75a443b2012-10-16 22:58:25 +000039 %feature("docstring", "Sets whether to unwind the expression stack on error.") SetUnwindOnError;
40
Jim Ingham47beabb2012-10-16 21:41:58 +000041 void
42 SetUnwindOnError (bool unwind = false);
43
Jim Ingham47beabb2012-10-16 21:41:58 +000044 lldb::DynamicValueType
Greg Clayton75a443b2012-10-16 22:58:25 +000045 GetFetchDynamicValue () const;
Jim Ingham47beabb2012-10-16 21:41:58 +000046
Greg Clayton75a443b2012-10-16 22:58:25 +000047 %feature("docstring", "Sets whether to cast the expression result to its dynamic type.") SetFetchDynamicValue;
48
Jim Ingham47beabb2012-10-16 21:41:58 +000049 void
Greg Clayton75a443b2012-10-16 22:58:25 +000050 SetFetchDynamicValue (lldb::DynamicValueType dynamic = lldb::eDynamicCanRunTarget);
51
Jim Ingham47beabb2012-10-16 21:41:58 +000052 uint32_t
Greg Clayton75a443b2012-10-16 22:58:25 +000053 GetTimeoutInMicroSeconds () const;
Jim Ingham47beabb2012-10-16 21:41:58 +000054
Greg Clayton75a443b2012-10-16 22:58:25 +000055 %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 Ingham47beabb2012-10-16 21:41:58 +000056 void
Greg Clayton75a443b2012-10-16 22:58:25 +000057 SetTimeoutInMicroSeconds (uint32_t timeout = 0);
Jim Ingham47beabb2012-10-16 21:41:58 +000058
59 bool
Greg Clayton75a443b2012-10-16 22:58:25 +000060 GetTryAllThreads () const;
Jim Ingham47beabb2012-10-16 21:41:58 +000061
Greg Clayton75a443b2012-10-16 22:58:25 +000062 %feature("docstring", "Sets whether to run all threads if the expression does not complete on one thread.") SetTryAllThreads;
Jim Ingham47beabb2012-10-16 21:41:58 +000063 void
Greg Clayton75a443b2012-10-16 22:58:25 +000064 SetTryAllThreads (bool run_others = true);
65
Jim Ingham47beabb2012-10-16 21:41:58 +000066protected:
67
68 SBExpressionOptions (lldb_private::EvaluateExpressionOptions &expression_options);
69
70 lldb_private::EvaluateExpressionOptions *
71 get () const;
72
73 lldb_private::EvaluateExpressionOptions &
74 ref () const;
75
76private:
77 // This auto_pointer is made in the constructor and is always valid.
78 mutable std::auto_ptr<lldb_private::EvaluateExpressionOptions> m_opaque_ap;
79};
80
81} // namespace lldb