1061da546Spatrick //===-- SWIG interface for SBExpressionOptions -----------------------------------------------*- C++ -*-===// 2061da546Spatrick // 3061da546Spatrick // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4061da546Spatrick // See https://llvm.org/LICENSE.txt for license information. 5061da546Spatrick // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6061da546Spatrick // 7061da546Spatrick //===----------------------------------------------------------------------===// 8061da546Spatrick 9061da546Spatrick namespace lldb { 10061da546Spatrick 11061da546Spatrick %feature("docstring", 12061da546Spatrick "A container for options to use when evaluating expressions." 13061da546Spatrick ) SBExpressionOptions; 14061da546Spatrick 15061da546Spatrick class SBExpressionOptions 16061da546Spatrick { 17061da546Spatrick friend class SBFrame; 18061da546Spatrick friend class SBValue; 19061da546Spatrick 20061da546Spatrick public: 21061da546Spatrick SBExpressionOptions(); 22061da546Spatrick 23061da546Spatrick SBExpressionOptions (const lldb::SBExpressionOptions &rhs); 24061da546Spatrick 25061da546Spatrick ~SBExpressionOptions(); 26061da546Spatrick 27061da546Spatrick bool 28061da546Spatrick GetCoerceResultToId () const; 29061da546Spatrick 30061da546Spatrick %feature("docstring", "Sets whether to coerce the expression result to ObjC id type after evaluation.") SetCoerceResultToId; 31061da546Spatrick 32061da546Spatrick void 33061da546Spatrick SetCoerceResultToId (bool coerce = true); 34061da546Spatrick 35061da546Spatrick bool 36061da546Spatrick GetUnwindOnError () const; 37061da546Spatrick 38061da546Spatrick %feature("docstring", "Sets whether to unwind the expression stack on error.") SetUnwindOnError; 39061da546Spatrick 40061da546Spatrick void 41061da546Spatrick SetUnwindOnError (bool unwind = true); 42061da546Spatrick 43061da546Spatrick bool 44061da546Spatrick GetIgnoreBreakpoints () const; 45061da546Spatrick 46061da546Spatrick %feature("docstring", "Sets whether to ignore breakpoint hits while running expressions.") SetUnwindOnError; 47061da546Spatrick 48061da546Spatrick void 49061da546Spatrick SetIgnoreBreakpoints (bool ignore = true); 50061da546Spatrick 51061da546Spatrick lldb::DynamicValueType 52061da546Spatrick GetFetchDynamicValue () const; 53061da546Spatrick 54061da546Spatrick %feature("docstring", "Sets whether to cast the expression result to its dynamic type.") SetFetchDynamicValue; 55061da546Spatrick 56061da546Spatrick void 57061da546Spatrick SetFetchDynamicValue (lldb::DynamicValueType dynamic = lldb::eDynamicCanRunTarget); 58061da546Spatrick 59061da546Spatrick uint32_t 60061da546Spatrick GetTimeoutInMicroSeconds () const; 61061da546Spatrick 62*dda28197Spatrick %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 expression will finish.") SetTimeoutInMicroSeconds; 63061da546Spatrick void 64061da546Spatrick SetTimeoutInMicroSeconds (uint32_t timeout = 0); 65061da546Spatrick 66061da546Spatrick uint32_t 67061da546Spatrick GetOneThreadTimeoutInMicroSeconds () const; 68061da546Spatrick 69061da546Spatrick %feature("docstring", "Sets the timeout in microseconds to run the expression on one thread before either timing out or trying all threads.") SetTimeoutInMicroSeconds; 70061da546Spatrick void 71061da546Spatrick SetOneThreadTimeoutInMicroSeconds (uint32_t timeout = 0); 72061da546Spatrick 73061da546Spatrick bool 74061da546Spatrick GetTryAllThreads () const; 75061da546Spatrick 76061da546Spatrick %feature("docstring", "Sets whether to run all threads if the expression does not complete on one thread.") SetTryAllThreads; 77061da546Spatrick void 78061da546Spatrick SetTryAllThreads (bool run_others = true); 79061da546Spatrick 80061da546Spatrick bool 81061da546Spatrick GetStopOthers () const; 82061da546Spatrick 83*dda28197Spatrick %feature("docstring", "Sets whether to stop other threads at all while running expressions. If false, TryAllThreads does nothing.") SetTryAllThreads; 84061da546Spatrick void 85061da546Spatrick SetStopOthers (bool stop_others = true); 86061da546Spatrick 87061da546Spatrick bool 88061da546Spatrick GetTrapExceptions () const; 89061da546Spatrick 90061da546Spatrick %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; 91061da546Spatrick void 92061da546Spatrick SetTrapExceptions (bool trap_exceptions = true); 93061da546Spatrick 94061da546Spatrick %feature ("docstring", "Sets the language that LLDB should assume the expression is written in") SetLanguage; 95061da546Spatrick void 96061da546Spatrick SetLanguage (lldb::LanguageType language); 97061da546Spatrick 98061da546Spatrick bool 99061da546Spatrick GetGenerateDebugInfo (); 100061da546Spatrick 101061da546Spatrick %feature("docstring", "Sets whether to generate debug information for the expression and also controls if a SBModule is generated.") SetGenerateDebugInfo; 102061da546Spatrick void 103061da546Spatrick SetGenerateDebugInfo (bool b = true); 104061da546Spatrick 105061da546Spatrick bool 106061da546Spatrick GetSuppressPersistentResult (); 107061da546Spatrick 108061da546Spatrick %feature("docstring", "Sets whether to produce a persistent result that can be used in future expressions.") SetSuppressPersistentResult; 109061da546Spatrick void 110061da546Spatrick SetSuppressPersistentResult (bool b = false); 111061da546Spatrick 112061da546Spatrick 113061da546Spatrick %feature("docstring", "Gets the prefix to use for this expression.") GetPrefix; 114061da546Spatrick const char * 115061da546Spatrick GetPrefix () const; 116061da546Spatrick 117061da546Spatrick %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; 118061da546Spatrick void 119061da546Spatrick SetPrefix (const char *prefix); 120061da546Spatrick 121061da546Spatrick %feature("docstring", "Sets whether to auto-apply fix-it hints to the expression being evaluated.") SetAutoApplyFixIts; 122061da546Spatrick void 123061da546Spatrick SetAutoApplyFixIts(bool b = true); 124061da546Spatrick 125061da546Spatrick %feature("docstring", "Gets whether to auto-apply fix-it hints to an expression.") GetAutoApplyFixIts; 126061da546Spatrick bool 127061da546Spatrick GetAutoApplyFixIts(); 128061da546Spatrick 129*dda28197Spatrick %feature("docstring", "Sets how often LLDB should retry applying fix-its to an expression.") SetRetriesWithFixIts; 130*dda28197Spatrick void 131*dda28197Spatrick SetRetriesWithFixIts(uint64_t retries); 132*dda28197Spatrick 133*dda28197Spatrick %feature("docstring", "Gets how often LLDB will retry applying fix-its to an expression.") GetRetriesWithFixIts; 134*dda28197Spatrick uint64_t 135*dda28197Spatrick GetRetriesWithFixIts(); 136*dda28197Spatrick 137061da546Spatrick bool 138061da546Spatrick GetTopLevel(); 139061da546Spatrick 140061da546Spatrick void 141061da546Spatrick SetTopLevel(bool b = true); 142061da546Spatrick 143061da546Spatrick %feature("docstring", "Gets whether to JIT an expression if it cannot be interpreted.") GetAllowJIT; 144061da546Spatrick bool 145061da546Spatrick GetAllowJIT(); 146061da546Spatrick 147061da546Spatrick %feature("docstring", "Sets whether to JIT an expression if it cannot be interpreted.") SetAllowJIT; 148061da546Spatrick void 149061da546Spatrick SetAllowJIT(bool allow); 150061da546Spatrick 151061da546Spatrick protected: 152061da546Spatrick 153061da546Spatrick SBExpressionOptions (lldb_private::EvaluateExpressionOptions &expression_options); 154061da546Spatrick 155061da546Spatrick lldb_private::EvaluateExpressionOptions * 156061da546Spatrick get () const; 157061da546Spatrick 158061da546Spatrick lldb_private::EvaluateExpressionOptions & 159061da546Spatrick ref () const; 160061da546Spatrick 161061da546Spatrick private: 162061da546Spatrick // This auto_pointer is made in the constructor and is always valid. 163061da546Spatrick mutable std::unique_ptr<lldb_private::EvaluateExpressionOptions> m_opaque_ap; 164061da546Spatrick }; 165061da546Spatrick 166061da546Spatrick } // namespace lldb 167