Jim Ingham | 47beabb | 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 | |
| 19 | SBExpressionOptions::SBExpressionOptions () |
| 20 | { |
| 21 | m_opaque_ap.reset(new EvaluateExpressionOptions()); |
| 22 | } |
| 23 | |
| 24 | SBExpressionOptions::SBExpressionOptions (bool coerce_to_id, |
| 25 | bool unwind_on_error, |
| 26 | bool keep_in_memory, |
| 27 | bool run_others, |
| 28 | DynamicValueType use_dynamic, |
| 29 | uint32_t timeout_usec) |
| 30 | { |
| 31 | m_opaque_ap.reset(new EvaluateExpressionOptions()); |
| 32 | m_opaque_ap->SetCoerceToId(coerce_to_id); |
| 33 | m_opaque_ap->SetUnwindOnError(unwind_on_error); |
| 34 | m_opaque_ap->SetKeepInMemory(keep_in_memory); |
| 35 | m_opaque_ap->SetRunOthers(run_others); |
| 36 | m_opaque_ap->SetUseDynamic (use_dynamic); |
| 37 | m_opaque_ap->SetTimeoutUsec (timeout_usec); |
| 38 | } |
| 39 | |
| 40 | SBExpressionOptions::SBExpressionOptions (const SBExpressionOptions &rhs) |
| 41 | { |
| 42 | m_opaque_ap.reset(new EvaluateExpressionOptions()); |
| 43 | *(m_opaque_ap.get()) = rhs.ref(); |
| 44 | } |
| 45 | |
| 46 | const SBExpressionOptions & |
| 47 | SBExpressionOptions::operator = (const SBExpressionOptions &rhs) |
| 48 | { |
| 49 | if (this != &rhs) |
| 50 | { |
| 51 | this->ref() = rhs.ref(); |
| 52 | } |
| 53 | return *this; |
| 54 | } |
| 55 | |
| 56 | SBExpressionOptions::~SBExpressionOptions() |
| 57 | { |
| 58 | } |
| 59 | |
| 60 | bool |
| 61 | SBExpressionOptions::DoesCoerceToId () const |
| 62 | { |
| 63 | return m_opaque_ap->DoesCoerceToId (); |
| 64 | } |
| 65 | |
| 66 | void |
| 67 | SBExpressionOptions::SetCoerceToId (bool coerce) |
| 68 | { |
| 69 | m_opaque_ap->SetCoerceToId (coerce); |
| 70 | } |
| 71 | |
| 72 | bool |
| 73 | SBExpressionOptions::DoesUnwindOnError () const |
| 74 | { |
| 75 | return m_opaque_ap->DoesUnwindOnError (); |
| 76 | } |
| 77 | |
| 78 | void |
| 79 | SBExpressionOptions::SetUnwindOnError (bool unwind) |
| 80 | { |
| 81 | m_opaque_ap->SetUnwindOnError (unwind); |
| 82 | } |
| 83 | |
| 84 | bool |
| 85 | SBExpressionOptions::DoesKeepInMemory () const |
| 86 | { |
| 87 | return m_opaque_ap->DoesKeepInMemory (); |
| 88 | } |
| 89 | |
| 90 | void |
| 91 | SBExpressionOptions::SetKeepInMemory (bool keep) |
| 92 | { |
| 93 | m_opaque_ap->SetKeepInMemory (keep); |
| 94 | } |
| 95 | |
| 96 | lldb::DynamicValueType |
| 97 | SBExpressionOptions::GetUseDynamic () const |
| 98 | { |
| 99 | return m_opaque_ap->GetUseDynamic (); |
| 100 | } |
| 101 | |
| 102 | void |
| 103 | SBExpressionOptions::SetUseDynamic (lldb::DynamicValueType dynamic) |
| 104 | { |
| 105 | m_opaque_ap->SetUseDynamic (dynamic); |
| 106 | } |
| 107 | |
| 108 | uint32_t |
| 109 | SBExpressionOptions::GetTimeoutUsec () const |
| 110 | { |
| 111 | return m_opaque_ap->GetTimeoutUsec (); |
| 112 | } |
| 113 | |
| 114 | void |
| 115 | SBExpressionOptions::SetTimeoutUsec (uint32_t timeout) |
| 116 | { |
| 117 | m_opaque_ap->SetTimeoutUsec (timeout); |
| 118 | } |
| 119 | |
| 120 | bool |
| 121 | SBExpressionOptions::GetRunOthers () const |
| 122 | { |
| 123 | return m_opaque_ap->GetRunOthers (); |
| 124 | } |
| 125 | |
| 126 | void |
| 127 | SBExpressionOptions::SetRunOthers (bool run_others) |
| 128 | { |
| 129 | m_opaque_ap->SetRunOthers (run_others); |
| 130 | } |
| 131 | |
| 132 | EvaluateExpressionOptions * |
| 133 | SBExpressionOptions::get() const |
| 134 | { |
| 135 | return m_opaque_ap.get(); |
| 136 | } |
| 137 | |
| 138 | EvaluateExpressionOptions & |
| 139 | SBExpressionOptions::ref () const |
| 140 | { |
| 141 | return *(m_opaque_ap.get()); |
| 142 | } |