Home | History | Annotate | Download | only in API
      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     m_opaque_ap(new EvaluateExpressionOptions())
     21 {
     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
     45 SBExpressionOptions::GetCoerceResultToId () const
     46 {
     47     return m_opaque_ap->DoesCoerceToId ();
     48 }
     49 
     50 void
     51 SBExpressionOptions::SetCoerceResultToId (bool coerce)
     52 {
     53     m_opaque_ap->SetCoerceToId (coerce);
     54 }
     55 
     56 bool
     57 SBExpressionOptions::GetUnwindOnError () const
     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 
     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 
     80 lldb::DynamicValueType
     81 SBExpressionOptions::GetFetchDynamicValue () const
     82 {
     83     return m_opaque_ap->GetUseDynamic ();
     84 }
     85 
     86 void
     87 SBExpressionOptions::SetFetchDynamicValue (lldb::DynamicValueType dynamic)
     88 {
     89     m_opaque_ap->SetUseDynamic (dynamic);
     90 }
     91 
     92 uint32_t
     93 SBExpressionOptions::GetTimeoutInMicroSeconds () const
     94 {
     95     return m_opaque_ap->GetTimeoutUsec ();
     96 }
     97 
     98 void
     99 SBExpressionOptions::SetTimeoutInMicroSeconds (uint32_t timeout)
    100 {
    101     m_opaque_ap->SetTimeoutUsec (timeout);
    102 }
    103 
    104 bool
    105 SBExpressionOptions::GetTryAllThreads () const
    106 {
    107     return m_opaque_ap->GetRunOthers ();
    108 }
    109 
    110 void
    111 SBExpressionOptions::SetTryAllThreads (bool run_others)
    112 {
    113     m_opaque_ap->SetRunOthers (run_others);
    114 }
    115 
    116 EvaluateExpressionOptions *
    117 SBExpressionOptions::get() const
    118 {
    119     return m_opaque_ap.get();
    120 }
    121 
    122 EvaluateExpressionOptions &
    123 SBExpressionOptions::ref () const
    124 {
    125     return *(m_opaque_ap.get());
    126 }
    127