1//===-- SWIG interface for SBExpressionOptions -----------------------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9namespace lldb {
10
11%feature("docstring",
12"A container for options to use when evaluating expressions."
13) SBExpressionOptions;
14
15class SBExpressionOptions
16{
17friend class SBFrame;
18friend class SBValue;
19
20public:
21    SBExpressionOptions();
22
23    SBExpressionOptions (const lldb::SBExpressionOptions &rhs);
24
25    ~SBExpressionOptions();
26
27    bool
28    GetCoerceResultToId () const;
29
30    %feature("docstring", "Sets whether to coerce the expression result to ObjC id type after evaluation.") SetCoerceResultToId;
31
32    void
33    SetCoerceResultToId (bool coerce = true);
34
35    bool
36    GetUnwindOnError () const;
37
38    %feature("docstring", "Sets whether to unwind the expression stack on error.") SetUnwindOnError;
39
40    void
41    SetUnwindOnError (bool unwind = true);
42
43    bool
44    GetIgnoreBreakpoints () const;
45
46    %feature("docstring", "Sets whether to ignore breakpoint hits while running expressions.") SetUnwindOnError;
47
48    void
49    SetIgnoreBreakpoints (bool ignore = true);
50
51    lldb::DynamicValueType
52    GetFetchDynamicValue () const;
53
54    %feature("docstring", "Sets whether to cast the expression result to its dynamic type.") SetFetchDynamicValue;
55
56    void
57    SetFetchDynamicValue (lldb::DynamicValueType dynamic = lldb::eDynamicCanRunTarget);
58
59    uint32_t
60    GetTimeoutInMicroSeconds () const;
61
62    %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;
63    void
64    SetTimeoutInMicroSeconds (uint32_t timeout = 0);
65
66    uint32_t
67    GetOneThreadTimeoutInMicroSeconds () const;
68
69    %feature("docstring", "Sets the timeout in microseconds to run the expression on one thread before either timing out or trying all threads.") SetTimeoutInMicroSeconds;
70    void
71    SetOneThreadTimeoutInMicroSeconds (uint32_t timeout = 0);
72
73    bool
74    GetTryAllThreads () const;
75
76    %feature("docstring", "Sets whether to run all threads if the expression does not complete on one thread.") SetTryAllThreads;
77    void
78    SetTryAllThreads (bool run_others = true);
79
80    bool
81    GetStopOthers () const;
82
83    %feature("docstring", "Sets whether to stop other threads at all while running expressins.  If false, TryAllThreads does nothing.") SetTryAllThreads;
84    void
85    SetStopOthers (bool stop_others = true);
86
87    bool
88    GetTrapExceptions () const;
89
90    %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;
91    void
92    SetTrapExceptions (bool trap_exceptions = true);
93
94    %feature ("docstring", "Sets the language that LLDB should assume the expression is written in") SetLanguage;
95    void
96    SetLanguage (lldb::LanguageType language);
97
98    bool
99    GetGenerateDebugInfo ();
100
101    %feature("docstring", "Sets whether to generate debug information for the expression and also controls if a SBModule is generated.") SetGenerateDebugInfo;
102    void
103    SetGenerateDebugInfo (bool b = true);
104
105    bool
106    GetSuppressPersistentResult ();
107
108    %feature("docstring", "Sets whether to produce a persistent result that can be used in future expressions.") SetSuppressPersistentResult;
109    void
110    SetSuppressPersistentResult (bool b = false);
111
112
113    %feature("docstring", "Gets the prefix to use for this expression.") GetPrefix;
114    const char *
115    GetPrefix () const;
116
117    %feature("docstring", "Sets the prefix to use for this expression. This prefix gets inserted after the 'target.expr-prefix' prefix contents, but before the wrapped expression function body.") SetPrefix;
118    void
119    SetPrefix (const char *prefix);
120
121    %feature("docstring", "Sets whether to auto-apply fix-it hints to the expression being evaluated.") SetAutoApplyFixIts;
122    void
123    SetAutoApplyFixIts(bool b = true);
124
125    %feature("docstring", "Gets whether to auto-apply fix-it hints to an expression.") GetAutoApplyFixIts;
126    bool
127    GetAutoApplyFixIts();
128
129    bool
130    GetTopLevel();
131
132    void
133    SetTopLevel(bool b = true);
134
135    %feature("docstring", "Gets whether to JIT an expression if it cannot be interpreted.") GetAllowJIT;
136    bool
137    GetAllowJIT();
138
139    %feature("docstring", "Sets whether to JIT an expression if it cannot be interpreted.") SetAllowJIT;
140    void
141    SetAllowJIT(bool allow);
142
143protected:
144
145    SBExpressionOptions (lldb_private::EvaluateExpressionOptions &expression_options);
146
147    lldb_private::EvaluateExpressionOptions *
148    get () const;
149
150    lldb_private::EvaluateExpressionOptions &
151    ref () const;
152
153private:
154    // This auto_pointer is made in the constructor and is always valid.
155    mutable std::unique_ptr<lldb_private::EvaluateExpressionOptions> m_opaque_ap;
156};
157
158} // namespace lldb
159