Jim Ingham | 35e1bda | 2012-10-16 21:41:58 +0000 | [diff] [blame] | 1 | //===-- SBExpressionOptions.cpp ---------------------------------------------*- 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 | #include "lldb/API/SBExpressionOptions.h" |
| 11 | #include "lldb/API/SBStream.h" |
| 12 | |
| 13 | #include "lldb/Target/Target.h" |
| 14 | |
| 15 | using namespace lldb; |
| 16 | using namespace lldb_private; |
| 17 | |
| 18 | |
Greg Clayton | cced156 | 2012-10-16 22:58:25 +0000 | [diff] [blame] | 19 | SBExpressionOptions::SBExpressionOptions () : |
| 20 | m_opaque_ap(new EvaluateExpressionOptions()) |
Jim Ingham | 35e1bda | 2012-10-16 21:41:58 +0000 | [diff] [blame] | 21 | { |
Jim Ingham | 35e1bda | 2012-10-16 21:41:58 +0000 | [diff] [blame] | 22 | } |
| 23 | |
| 24 | SBExpressionOptions::SBExpressionOptions (const SBExpressionOptions &rhs) |
| 25 | { |
| 26 | m_opaque_ap.reset(new EvaluateExpressionOptions()); |
| 27 | *(m_opaque_ap.get()) = rhs.ref(); |
| 28 | } |
| 29 | |
| 30 | const SBExpressionOptions & |
| 31 | SBExpressionOptions::operator = (const SBExpressionOptions &rhs) |
| 32 | { |
| 33 | if (this != &rhs) |
| 34 | { |
| 35 | this->ref() = rhs.ref(); |
| 36 | } |
| 37 | return *this; |
| 38 | } |
| 39 | |
| 40 | SBExpressionOptions::~SBExpressionOptions() |
| 41 | { |
| 42 | } |
| 43 | |
| 44 | bool |
Greg Clayton | cced156 | 2012-10-16 22:58:25 +0000 | [diff] [blame] | 45 | SBExpressionOptions::GetCoerceResultToId () const |
Jim Ingham | 35e1bda | 2012-10-16 21:41:58 +0000 | [diff] [blame] | 46 | { |
| 47 | return m_opaque_ap->DoesCoerceToId (); |
| 48 | } |
| 49 | |
| 50 | void |
Greg Clayton | cced156 | 2012-10-16 22:58:25 +0000 | [diff] [blame] | 51 | SBExpressionOptions::SetCoerceResultToId (bool coerce) |
Jim Ingham | 35e1bda | 2012-10-16 21:41:58 +0000 | [diff] [blame] | 52 | { |
| 53 | m_opaque_ap->SetCoerceToId (coerce); |
| 54 | } |
| 55 | |
| 56 | bool |
Greg Clayton | cced156 | 2012-10-16 22:58:25 +0000 | [diff] [blame] | 57 | SBExpressionOptions::GetUnwindOnError () const |
Jim Ingham | 35e1bda | 2012-10-16 21:41:58 +0000 | [diff] [blame] | 58 | { |
| 59 | return m_opaque_ap->DoesUnwindOnError (); |
| 60 | } |
| 61 | |
| 62 | void |
| 63 | SBExpressionOptions::SetUnwindOnError (bool unwind) |
| 64 | { |
| 65 | m_opaque_ap->SetUnwindOnError (unwind); |
| 66 | } |
| 67 | |
Jim Ingham | 184e981 | 2013-01-15 02:47:48 +0000 | [diff] [blame] | 68 | bool |
| 69 | SBExpressionOptions::GetIgnoreBreakpoints () const |
| 70 | { |
| 71 | return m_opaque_ap->DoesIgnoreBreakpoints (); |
| 72 | } |
| 73 | |
| 74 | void |
| 75 | SBExpressionOptions::SetIgnoreBreakpoints (bool ignore) |
| 76 | { |
| 77 | m_opaque_ap->SetIgnoreBreakpoints (ignore); |
| 78 | } |
| 79 | |
Jim Ingham | 35e1bda | 2012-10-16 21:41:58 +0000 | [diff] [blame] | 80 | lldb::DynamicValueType |
Greg Clayton | cced156 | 2012-10-16 22:58:25 +0000 | [diff] [blame] | 81 | SBExpressionOptions::GetFetchDynamicValue () const |
Jim Ingham | 35e1bda | 2012-10-16 21:41:58 +0000 | [diff] [blame] | 82 | { |
| 83 | return m_opaque_ap->GetUseDynamic (); |
| 84 | } |
| 85 | |
| 86 | void |
Greg Clayton | cced156 | 2012-10-16 22:58:25 +0000 | [diff] [blame] | 87 | SBExpressionOptions::SetFetchDynamicValue (lldb::DynamicValueType dynamic) |
Jim Ingham | 35e1bda | 2012-10-16 21:41:58 +0000 | [diff] [blame] | 88 | { |
| 89 | m_opaque_ap->SetUseDynamic (dynamic); |
| 90 | } |
| 91 | |
| 92 | uint32_t |
Greg Clayton | cced156 | 2012-10-16 22:58:25 +0000 | [diff] [blame] | 93 | SBExpressionOptions::GetTimeoutInMicroSeconds () const |
Jim Ingham | 35e1bda | 2012-10-16 21:41:58 +0000 | [diff] [blame] | 94 | { |
| 95 | return m_opaque_ap->GetTimeoutUsec (); |
| 96 | } |
| 97 | |
| 98 | void |
Greg Clayton | cced156 | 2012-10-16 22:58:25 +0000 | [diff] [blame] | 99 | SBExpressionOptions::SetTimeoutInMicroSeconds (uint32_t timeout) |
Jim Ingham | 35e1bda | 2012-10-16 21:41:58 +0000 | [diff] [blame] | 100 | { |
| 101 | m_opaque_ap->SetTimeoutUsec (timeout); |
| 102 | } |
| 103 | |
Jim Ingham | 914f4e7 | 2014-03-28 21:58:28 +0000 | [diff] [blame] | 104 | uint32_t |
| 105 | SBExpressionOptions::GetOneThreadTimeoutInMicroSeconds () const |
| 106 | { |
| 107 | return m_opaque_ap->GetOneThreadTimeoutUsec (); |
| 108 | } |
| 109 | |
| 110 | void |
| 111 | SBExpressionOptions::SetOneThreadTimeoutInMicroSeconds (uint32_t timeout) |
| 112 | { |
| 113 | m_opaque_ap->SetOneThreadTimeoutUsec (timeout); |
| 114 | } |
| 115 | |
Jim Ingham | 35e1bda | 2012-10-16 21:41:58 +0000 | [diff] [blame] | 116 | bool |
Greg Clayton | cced156 | 2012-10-16 22:58:25 +0000 | [diff] [blame] | 117 | SBExpressionOptions::GetTryAllThreads () const |
Jim Ingham | 35e1bda | 2012-10-16 21:41:58 +0000 | [diff] [blame] | 118 | { |
Jim Ingham | 6fbc48b | 2013-11-07 00:11:47 +0000 | [diff] [blame] | 119 | return m_opaque_ap->GetTryAllThreads (); |
Jim Ingham | 35e1bda | 2012-10-16 21:41:58 +0000 | [diff] [blame] | 120 | } |
| 121 | |
| 122 | void |
Greg Clayton | cced156 | 2012-10-16 22:58:25 +0000 | [diff] [blame] | 123 | SBExpressionOptions::SetTryAllThreads (bool run_others) |
Jim Ingham | 35e1bda | 2012-10-16 21:41:58 +0000 | [diff] [blame] | 124 | { |
Jim Ingham | 6fbc48b | 2013-11-07 00:11:47 +0000 | [diff] [blame] | 125 | m_opaque_ap->SetTryAllThreads (run_others); |
| 126 | } |
| 127 | |
| 128 | bool |
Jim Ingham | 286fb1e | 2014-02-28 02:52:06 +0000 | [diff] [blame] | 129 | SBExpressionOptions::GetStopOthers () const |
| 130 | { |
| 131 | return m_opaque_ap->GetStopOthers (); |
| 132 | } |
| 133 | |
| 134 | void |
| 135 | SBExpressionOptions::SetStopOthers (bool run_others) |
| 136 | { |
| 137 | m_opaque_ap->SetStopOthers (run_others); |
| 138 | } |
| 139 | |
| 140 | bool |
Jim Ingham | 6fbc48b | 2013-11-07 00:11:47 +0000 | [diff] [blame] | 141 | SBExpressionOptions::GetTrapExceptions () const |
| 142 | { |
| 143 | return m_opaque_ap->GetTrapExceptions (); |
| 144 | } |
| 145 | |
| 146 | void |
| 147 | SBExpressionOptions::SetTrapExceptions (bool trap_exceptions) |
| 148 | { |
| 149 | m_opaque_ap->SetTrapExceptions (trap_exceptions); |
Jim Ingham | 35e1bda | 2012-10-16 21:41:58 +0000 | [diff] [blame] | 150 | } |
| 151 | |
Jim Ingham | 1624a2d | 2014-05-05 02:26:40 +0000 | [diff] [blame^] | 152 | void |
| 153 | SBExpressionOptions::SetCancelCallback (lldb::ExpressionCancelCallback callback, void *baton) |
| 154 | { |
| 155 | m_opaque_ap->SetCancelCallback (callback, baton); |
| 156 | } |
| 157 | |
Jim Ingham | 35e1bda | 2012-10-16 21:41:58 +0000 | [diff] [blame] | 158 | EvaluateExpressionOptions * |
| 159 | SBExpressionOptions::get() const |
| 160 | { |
| 161 | return m_opaque_ap.get(); |
| 162 | } |
| 163 | |
| 164 | EvaluateExpressionOptions & |
| 165 | SBExpressionOptions::ref () const |
| 166 | { |
| 167 | return *(m_opaque_ap.get()); |
| 168 | } |