1 //===-- SBExpressionOptions.cpp ---------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "lldb/API/SBExpressionOptions.h"
11 #include "lldb/API/SBStream.h"
13 #include "lldb/Target/Target.h"
16 using namespace lldb_private;
19 SBExpressionOptions::SBExpressionOptions () :
20 m_opaque_ap(new EvaluateExpressionOptions())
24 SBExpressionOptions::SBExpressionOptions (const SBExpressionOptions &rhs)
26 m_opaque_ap.reset(new EvaluateExpressionOptions());
27 *(m_opaque_ap.get()) = rhs.ref();
30 const SBExpressionOptions &
31 SBExpressionOptions::operator = (const SBExpressionOptions &rhs)
35 this->ref() = rhs.ref();
40 SBExpressionOptions::~SBExpressionOptions()
45 SBExpressionOptions::GetCoerceResultToId () const
47 return m_opaque_ap->DoesCoerceToId ();
51 SBExpressionOptions::SetCoerceResultToId (bool coerce)
53 m_opaque_ap->SetCoerceToId (coerce);
57 SBExpressionOptions::GetUnwindOnError () const
59 return m_opaque_ap->DoesUnwindOnError ();
63 SBExpressionOptions::SetUnwindOnError (bool unwind)
65 m_opaque_ap->SetUnwindOnError (unwind);
69 SBExpressionOptions::GetIgnoreBreakpoints () const
71 return m_opaque_ap->DoesIgnoreBreakpoints ();
75 SBExpressionOptions::SetIgnoreBreakpoints (bool ignore)
77 m_opaque_ap->SetIgnoreBreakpoints (ignore);
80 lldb::DynamicValueType
81 SBExpressionOptions::GetFetchDynamicValue () const
83 return m_opaque_ap->GetUseDynamic ();
87 SBExpressionOptions::SetFetchDynamicValue (lldb::DynamicValueType dynamic)
89 m_opaque_ap->SetUseDynamic (dynamic);
93 SBExpressionOptions::GetTimeoutInMicroSeconds () const
95 return m_opaque_ap->GetTimeoutUsec ();
99 SBExpressionOptions::SetTimeoutInMicroSeconds (uint32_t timeout)
101 m_opaque_ap->SetTimeoutUsec (timeout);
105 SBExpressionOptions::GetOneThreadTimeoutInMicroSeconds () const
107 return m_opaque_ap->GetOneThreadTimeoutUsec ();
111 SBExpressionOptions::SetOneThreadTimeoutInMicroSeconds (uint32_t timeout)
113 m_opaque_ap->SetOneThreadTimeoutUsec (timeout);
117 SBExpressionOptions::GetTryAllThreads () const
119 return m_opaque_ap->GetTryAllThreads ();
123 SBExpressionOptions::SetTryAllThreads (bool run_others)
125 m_opaque_ap->SetTryAllThreads (run_others);
129 SBExpressionOptions::GetStopOthers () const
131 return m_opaque_ap->GetStopOthers ();
135 SBExpressionOptions::SetStopOthers (bool run_others)
137 m_opaque_ap->SetStopOthers (run_others);
141 SBExpressionOptions::GetTrapExceptions () const
143 return m_opaque_ap->GetTrapExceptions ();
147 SBExpressionOptions::SetTrapExceptions (bool trap_exceptions)
149 m_opaque_ap->SetTrapExceptions (trap_exceptions);
153 SBExpressionOptions::SetLanguage (lldb::LanguageType language)
155 m_opaque_ap->SetLanguage(language);
159 SBExpressionOptions::SetCancelCallback (lldb::ExpressionCancelCallback callback, void *baton)
161 m_opaque_ap->SetCancelCallback (callback, baton);
165 SBExpressionOptions::GetGenerateDebugInfo ()
167 return m_opaque_ap->GetGenerateDebugInfo();
171 SBExpressionOptions::SetGenerateDebugInfo (bool b)
173 return m_opaque_ap->SetGenerateDebugInfo(b);
177 SBExpressionOptions::GetSuppressPersistentResult ()
179 return m_opaque_ap->GetResultIsInternal ();
183 SBExpressionOptions::SetSuppressPersistentResult (bool b)
185 return m_opaque_ap->SetResultIsInternal (b);
189 SBExpressionOptions::GetPrefix () const
191 return m_opaque_ap->GetPrefix();
195 SBExpressionOptions::SetPrefix (const char *prefix)
197 return m_opaque_ap->SetPrefix(prefix);
201 SBExpressionOptions::GetAutoApplyFixIts ()
203 return m_opaque_ap->GetAutoApplyFixIts ();
207 SBExpressionOptions::SetAutoApplyFixIts (bool b)
209 return m_opaque_ap->SetAutoApplyFixIts (b);
213 SBExpressionOptions::GetTopLevel ()
215 return m_opaque_ap->GetExecutionPolicy() == eExecutionPolicyTopLevel;
219 SBExpressionOptions::SetTopLevel (bool b)
221 m_opaque_ap->SetExecutionPolicy(b ? eExecutionPolicyTopLevel : m_opaque_ap->default_execution_policy);
224 EvaluateExpressionOptions *
225 SBExpressionOptions::get() const
227 return m_opaque_ap.get();
230 EvaluateExpressionOptions &
231 SBExpressionOptions::ref () const
233 return *(m_opaque_ap.get());