1 //===-- SBExpressionOptions.h -----------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_SBExpressionOptions_h_
10 #define LLDB_SBExpressionOptions_h_
12 #include "lldb/API/SBDefines.h"
18 class LLDB_API SBExpressionOptions {
20 SBExpressionOptions();
22 SBExpressionOptions(const lldb::SBExpressionOptions &rhs);
24 ~SBExpressionOptions();
26 const SBExpressionOptions &operator=(const lldb::SBExpressionOptions &rhs);
28 bool GetCoerceResultToId() const;
30 void SetCoerceResultToId(bool coerce = true);
32 bool GetUnwindOnError() const;
34 void SetUnwindOnError(bool unwind = true);
36 bool GetIgnoreBreakpoints() const;
38 void SetIgnoreBreakpoints(bool ignore = true);
40 lldb::DynamicValueType GetFetchDynamicValue() const;
42 void SetFetchDynamicValue(
43 lldb::DynamicValueType dynamic = lldb::eDynamicCanRunTarget);
45 uint32_t GetTimeoutInMicroSeconds() const;
47 // Set the timeout for the expression, 0 means wait forever.
48 void SetTimeoutInMicroSeconds(uint32_t timeout = 0);
50 uint32_t GetOneThreadTimeoutInMicroSeconds() const;
52 // Set the timeout for running on one thread, 0 means use the default
53 // behavior. If you set this higher than the overall timeout, you'll get an
54 // error when you try to run the expression.
55 void SetOneThreadTimeoutInMicroSeconds(uint32_t timeout = 0);
57 bool GetTryAllThreads() const;
59 void SetTryAllThreads(bool run_others = true);
61 bool GetStopOthers() const;
63 void SetStopOthers(bool stop_others = true);
65 bool GetTrapExceptions() const;
67 void SetTrapExceptions(bool trap_exceptions = true);
69 void SetLanguage(lldb::LanguageType language);
71 void SetCancelCallback(lldb::ExpressionCancelCallback callback, void *baton);
73 bool GetGenerateDebugInfo();
75 void SetGenerateDebugInfo(bool b = true);
77 bool GetSuppressPersistentResult();
79 void SetSuppressPersistentResult(bool b = false);
81 const char *GetPrefix() const;
83 void SetPrefix(const char *prefix);
85 void SetAutoApplyFixIts(bool b = true);
87 bool GetAutoApplyFixIts();
91 void SetTopLevel(bool b = true);
93 // Gets whether we will JIT an expression if it cannot be interpreted
96 // Sets whether we will JIT an expression if it cannot be interpreted
97 void SetAllowJIT(bool allow);
100 lldb_private::EvaluateExpressionOptions *get() const;
102 lldb_private::EvaluateExpressionOptions &ref() const;
104 friend class SBFrame;
105 friend class SBValue;
106 friend class SBTarget;
109 // This auto_pointer is made in the constructor and is always valid.
110 mutable std::unique_ptr<lldb_private::EvaluateExpressionOptions> m_opaque_up;
115 #endif // LLDB_SBExpressionOptions_h_