Jim Ingham | 35e1bda | 2012-10-16 21:41:58 +0000 | [diff] [blame] | 1 | //===-- 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 | |
| 10 | namespace lldb { |
| 11 | |
| 12 | %feature("docstring", |
| 13 | "A container for options to use when evaluating expressions." |
| 14 | ) SBExpressionOptions; |
| 15 | |
| 16 | class SBExpressionOptions |
| 17 | { |
| 18 | friend class SBFrame; |
| 19 | friend class SBValue; |
| 20 | |
| 21 | public: |
| 22 | SBExpressionOptions(); |
| 23 | |
| 24 | SBExpressionOptions (const lldb::SBExpressionOptions &rhs); |
| 25 | |
Jim Ingham | 35e1bda | 2012-10-16 21:41:58 +0000 | [diff] [blame] | 26 | ~SBExpressionOptions(); |
| 27 | |
| 28 | bool |
Greg Clayton | cced156 | 2012-10-16 22:58:25 +0000 | [diff] [blame] | 29 | GetCoerceResultToId () const; |
Jim Ingham | 35e1bda | 2012-10-16 21:41:58 +0000 | [diff] [blame] | 30 | |
Greg Clayton | cced156 | 2012-10-16 22:58:25 +0000 | [diff] [blame] | 31 | %feature("docstring", "Sets whether to coerce the expression result to ObjC id type after evaluation.") SetCoerceResultToId; |
| 32 | |
Jim Ingham | 35e1bda | 2012-10-16 21:41:58 +0000 | [diff] [blame] | 33 | void |
Greg Clayton | cced156 | 2012-10-16 22:58:25 +0000 | [diff] [blame] | 34 | SetCoerceResultToId (bool coerce = true); |
Jim Ingham | 35e1bda | 2012-10-16 21:41:58 +0000 | [diff] [blame] | 35 | |
| 36 | bool |
Greg Clayton | cced156 | 2012-10-16 22:58:25 +0000 | [diff] [blame] | 37 | GetUnwindOnError () const; |
Jim Ingham | 35e1bda | 2012-10-16 21:41:58 +0000 | [diff] [blame] | 38 | |
Greg Clayton | cced156 | 2012-10-16 22:58:25 +0000 | [diff] [blame] | 39 | %feature("docstring", "Sets whether to unwind the expression stack on error.") SetUnwindOnError; |
| 40 | |
Jim Ingham | 35e1bda | 2012-10-16 21:41:58 +0000 | [diff] [blame] | 41 | void |
Jim Ingham | 0161b49 | 2013-02-09 01:29:05 +0000 | [diff] [blame] | 42 | SetUnwindOnError (bool unwind = true); |
Jim Ingham | 35e1bda | 2012-10-16 21:41:58 +0000 | [diff] [blame] | 43 | |
Jim Ingham | 184e981 | 2013-01-15 02:47:48 +0000 | [diff] [blame] | 44 | bool |
| 45 | GetIgnoreBreakpoints () const; |
| 46 | |
| 47 | %feature("docstring", "Sets whether to ignore breakpoint hits while running expressions.") SetUnwindOnError; |
| 48 | |
| 49 | void |
Jim Ingham | 0161b49 | 2013-02-09 01:29:05 +0000 | [diff] [blame] | 50 | SetIgnoreBreakpoints (bool ignore = true); |
Jim Ingham | 184e981 | 2013-01-15 02:47:48 +0000 | [diff] [blame] | 51 | |
Jim Ingham | 35e1bda | 2012-10-16 21:41:58 +0000 | [diff] [blame] | 52 | lldb::DynamicValueType |
Greg Clayton | cced156 | 2012-10-16 22:58:25 +0000 | [diff] [blame] | 53 | GetFetchDynamicValue () const; |
Jim Ingham | 35e1bda | 2012-10-16 21:41:58 +0000 | [diff] [blame] | 54 | |
Greg Clayton | cced156 | 2012-10-16 22:58:25 +0000 | [diff] [blame] | 55 | %feature("docstring", "Sets whether to cast the expression result to its dynamic type.") SetFetchDynamicValue; |
| 56 | |
Jim Ingham | 35e1bda | 2012-10-16 21:41:58 +0000 | [diff] [blame] | 57 | void |
Greg Clayton | cced156 | 2012-10-16 22:58:25 +0000 | [diff] [blame] | 58 | SetFetchDynamicValue (lldb::DynamicValueType dynamic = lldb::eDynamicCanRunTarget); |
| 59 | |
Jim Ingham | 35e1bda | 2012-10-16 21:41:58 +0000 | [diff] [blame] | 60 | uint32_t |
Greg Clayton | cced156 | 2012-10-16 22:58:25 +0000 | [diff] [blame] | 61 | GetTimeoutInMicroSeconds () const; |
Jim Ingham | 35e1bda | 2012-10-16 21:41:58 +0000 | [diff] [blame] | 62 | |
Greg Clayton | cced156 | 2012-10-16 22:58:25 +0000 | [diff] [blame] | 63 | %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 Ingham | 35e1bda | 2012-10-16 21:41:58 +0000 | [diff] [blame] | 64 | void |
Greg Clayton | cced156 | 2012-10-16 22:58:25 +0000 | [diff] [blame] | 65 | SetTimeoutInMicroSeconds (uint32_t timeout = 0); |
Jim Ingham | 35e1bda | 2012-10-16 21:41:58 +0000 | [diff] [blame] | 66 | |
Jim Ingham | 914f4e7 | 2014-03-28 21:58:28 +0000 | [diff] [blame] | 67 | uint32_t |
| 68 | GetOneThreadTimeoutInMicroSeconds () const; |
| 69 | |
| 70 | %feature("docstring", "Sets the timeout in microseconds to run the expression on one thread before either timing out or trying all threads.") SetTimeoutInMicroSeconds; |
| 71 | void |
| 72 | SetOneThreadTimeoutInMicroSeconds (uint32_t timeout = 0); |
| 73 | |
Jim Ingham | 35e1bda | 2012-10-16 21:41:58 +0000 | [diff] [blame] | 74 | bool |
Greg Clayton | cced156 | 2012-10-16 22:58:25 +0000 | [diff] [blame] | 75 | GetTryAllThreads () const; |
Jim Ingham | 35e1bda | 2012-10-16 21:41:58 +0000 | [diff] [blame] | 76 | |
Greg Clayton | cced156 | 2012-10-16 22:58:25 +0000 | [diff] [blame] | 77 | %feature("docstring", "Sets whether to run all threads if the expression does not complete on one thread.") SetTryAllThreads; |
Jim Ingham | 35e1bda | 2012-10-16 21:41:58 +0000 | [diff] [blame] | 78 | void |
Greg Clayton | cced156 | 2012-10-16 22:58:25 +0000 | [diff] [blame] | 79 | SetTryAllThreads (bool run_others = true); |
| 80 | |
Jim Ingham | 6fbc48b | 2013-11-07 00:11:47 +0000 | [diff] [blame] | 81 | bool |
Jim Ingham | 286fb1e | 2014-02-28 02:52:06 +0000 | [diff] [blame] | 82 | GetStopOthers () const; |
| 83 | |
| 84 | %feature("docstring", "Sets whether to stop other threads at all while running expressins. If false, TryAllThreads does nothing.") SetTryAllThreads; |
| 85 | void |
| 86 | SetStopOthers (bool stop_others = true); |
| 87 | |
| 88 | bool |
Jim Ingham | 6fbc48b | 2013-11-07 00:11:47 +0000 | [diff] [blame] | 89 | GetTrapExceptions () const; |
| 90 | |
| 91 | %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; |
| 92 | void |
| 93 | SetTrapExceptions (bool trap_exceptions = true); |
| 94 | |
Jason Molenda | 705b180 | 2014-06-13 02:37:02 +0000 | [diff] [blame] | 95 | %feature ("docstring", "Sets the language that LLDB should assume the expression is written in") SetLanguage; |
| 96 | void |
| 97 | SetLanguage (lldb::LanguageType language); |
Greg Clayton | 205ca1e | 2014-07-11 01:03:57 +0000 | [diff] [blame] | 98 | |
| 99 | bool |
| 100 | GetGenerateDebugInfo (); |
| 101 | |
| 102 | %feature("docstring", "Sets whether to generate debug information for the expression and also controls if a SBModule is generated.") SetGenerateDebugInfo; |
| 103 | void |
| 104 | SetGenerateDebugInfo (bool b = true); |
Jim Ingham | 7ab079b | 2014-08-08 21:45:36 +0000 | [diff] [blame] | 105 | |
| 106 | bool |
| 107 | GetSuppressPersistentResult (); |
| 108 | |
| 109 | %feature("docstring", "Sets whether to produce a persistent result that can be used in future expressions.") SetSuppressPersistentResult; |
| 110 | void |
| 111 | SetSuppressPersistentResult (bool b = false); |
| 112 | |
| 113 | |
Greg Clayton | 205ca1e | 2014-07-11 01:03:57 +0000 | [diff] [blame] | 114 | |
Jim Ingham | 35e1bda | 2012-10-16 21:41:58 +0000 | [diff] [blame] | 115 | protected: |
| 116 | |
| 117 | SBExpressionOptions (lldb_private::EvaluateExpressionOptions &expression_options); |
| 118 | |
| 119 | lldb_private::EvaluateExpressionOptions * |
| 120 | get () const; |
| 121 | |
| 122 | lldb_private::EvaluateExpressionOptions & |
| 123 | ref () const; |
| 124 | |
| 125 | private: |
| 126 | // This auto_pointer is made in the constructor and is always valid. |
Greg Clayton | 7b0992d | 2013-04-18 22:45:39 +0000 | [diff] [blame] | 127 | mutable std::unique_ptr<lldb_private::EvaluateExpressionOptions> m_opaque_ap; |
Jim Ingham | 35e1bda | 2012-10-16 21:41:58 +0000 | [diff] [blame] | 128 | }; |
| 129 | |
| 130 | } // namespace lldb |