1 //===-- SBExpressionOptions.h -----------------------------------*- 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 9 #ifndef LLDB_SBExpressionOptions_h_ 10 #define LLDB_SBExpressionOptions_h_ 11 12 #include "lldb/API/SBDefines.h" 13 14 #include <vector> 15 16 namespace lldb { 17 18 class LLDB_API SBExpressionOptions { 19 public: 20 SBExpressionOptions(); 21 22 SBExpressionOptions(const lldb::SBExpressionOptions &rhs); 23 24 ~SBExpressionOptions(); 25 26 const SBExpressionOptions &operator=(const lldb::SBExpressionOptions &rhs); 27 28 bool GetCoerceResultToId() const; 29 30 void SetCoerceResultToId(bool coerce = true); 31 32 bool GetUnwindOnError() const; 33 34 void SetUnwindOnError(bool unwind = true); 35 36 bool GetIgnoreBreakpoints() const; 37 38 void SetIgnoreBreakpoints(bool ignore = true); 39 40 lldb::DynamicValueType GetFetchDynamicValue() const; 41 42 void SetFetchDynamicValue( 43 lldb::DynamicValueType dynamic = lldb::eDynamicCanRunTarget); 44 45 uint32_t GetTimeoutInMicroSeconds() const; 46 47 // Set the timeout for the expression, 0 means wait forever. 48 void SetTimeoutInMicroSeconds(uint32_t timeout = 0); 49 50 uint32_t GetOneThreadTimeoutInMicroSeconds() const; 51 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); 56 57 bool GetTryAllThreads() const; 58 59 void SetTryAllThreads(bool run_others = true); 60 61 bool GetStopOthers() const; 62 63 void SetStopOthers(bool stop_others = true); 64 65 bool GetTrapExceptions() const; 66 67 void SetTrapExceptions(bool trap_exceptions = true); 68 69 void SetLanguage(lldb::LanguageType language); 70 71 void SetCancelCallback(lldb::ExpressionCancelCallback callback, void *baton); 72 73 bool GetGenerateDebugInfo(); 74 75 void SetGenerateDebugInfo(bool b = true); 76 77 bool GetSuppressPersistentResult(); 78 79 void SetSuppressPersistentResult(bool b = false); 80 81 const char *GetPrefix() const; 82 83 void SetPrefix(const char *prefix); 84 85 void SetAutoApplyFixIts(bool b = true); 86 87 bool GetAutoApplyFixIts(); 88 89 bool GetTopLevel(); 90 91 void SetTopLevel(bool b = true); 92 93 // Gets whether we will JIT an expression if it cannot be interpreted 94 bool GetAllowJIT(); 95 96 // Sets whether we will JIT an expression if it cannot be interpreted 97 void SetAllowJIT(bool allow); 98 99 protected: 100 lldb_private::EvaluateExpressionOptions *get() const; 101 102 lldb_private::EvaluateExpressionOptions &ref() const; 103 104 friend class SBFrame; 105 friend class SBValue; 106 friend class SBTarget; 107 108 private: 109 // This auto_pointer is made in the constructor and is always valid. 110 mutable std::unique_ptr<lldb_private::EvaluateExpressionOptions> m_opaque_up; 111 }; 112 113 } // namespace lldb 114 115 #endif // LLDB_SBExpressionOptions_h_ 116