xref: /NextBSD/contrib/llvm/tools/lldb/source/API/SBExpressionOptions.cpp (revision 84d351007654069f9643c8e4b4802a7f5f08ee42)
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 
SBExpressionOptions()19 SBExpressionOptions::SBExpressionOptions () :
20     m_opaque_ap(new EvaluateExpressionOptions())
21 {
22 }
23 
SBExpressionOptions(const SBExpressionOptions & rhs)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 &
operator =(const SBExpressionOptions & rhs)31 SBExpressionOptions::operator = (const SBExpressionOptions &rhs)
32 {
33     if (this != &rhs)
34     {
35         this->ref() = rhs.ref();
36     }
37     return *this;
38 }
39 
~SBExpressionOptions()40 SBExpressionOptions::~SBExpressionOptions()
41 {
42 }
43 
44 bool
GetCoerceResultToId() const45 SBExpressionOptions::GetCoerceResultToId () const
46 {
47     return m_opaque_ap->DoesCoerceToId ();
48 }
49 
50 void
SetCoerceResultToId(bool coerce)51 SBExpressionOptions::SetCoerceResultToId (bool coerce)
52 {
53     m_opaque_ap->SetCoerceToId (coerce);
54 }
55 
56 bool
GetUnwindOnError() const57 SBExpressionOptions::GetUnwindOnError () const
58 {
59     return m_opaque_ap->DoesUnwindOnError ();
60 }
61 
62 void
SetUnwindOnError(bool unwind)63 SBExpressionOptions::SetUnwindOnError (bool unwind)
64 {
65     m_opaque_ap->SetUnwindOnError (unwind);
66 }
67 
68 bool
GetIgnoreBreakpoints() const69 SBExpressionOptions::GetIgnoreBreakpoints () const
70 {
71     return m_opaque_ap->DoesIgnoreBreakpoints ();
72 }
73 
74 void
SetIgnoreBreakpoints(bool ignore)75 SBExpressionOptions::SetIgnoreBreakpoints (bool ignore)
76 {
77     m_opaque_ap->SetIgnoreBreakpoints (ignore);
78 }
79 
80 lldb::DynamicValueType
GetFetchDynamicValue() const81 SBExpressionOptions::GetFetchDynamicValue () const
82 {
83     return m_opaque_ap->GetUseDynamic ();
84 }
85 
86 void
SetFetchDynamicValue(lldb::DynamicValueType dynamic)87 SBExpressionOptions::SetFetchDynamicValue (lldb::DynamicValueType dynamic)
88 {
89     m_opaque_ap->SetUseDynamic (dynamic);
90 }
91 
92 uint32_t
GetTimeoutInMicroSeconds() const93 SBExpressionOptions::GetTimeoutInMicroSeconds () const
94 {
95     return m_opaque_ap->GetTimeoutUsec ();
96 }
97 
98 void
SetTimeoutInMicroSeconds(uint32_t timeout)99 SBExpressionOptions::SetTimeoutInMicroSeconds (uint32_t timeout)
100 {
101     m_opaque_ap->SetTimeoutUsec (timeout);
102 }
103 
104 uint32_t
GetOneThreadTimeoutInMicroSeconds() const105 SBExpressionOptions::GetOneThreadTimeoutInMicroSeconds () const
106 {
107     return m_opaque_ap->GetOneThreadTimeoutUsec ();
108 }
109 
110 void
SetOneThreadTimeoutInMicroSeconds(uint32_t timeout)111 SBExpressionOptions::SetOneThreadTimeoutInMicroSeconds (uint32_t timeout)
112 {
113     m_opaque_ap->SetOneThreadTimeoutUsec (timeout);
114 }
115 
116 bool
GetTryAllThreads() const117 SBExpressionOptions::GetTryAllThreads () const
118 {
119     return m_opaque_ap->GetTryAllThreads ();
120 }
121 
122 void
SetTryAllThreads(bool run_others)123 SBExpressionOptions::SetTryAllThreads (bool run_others)
124 {
125     m_opaque_ap->SetTryAllThreads (run_others);
126 }
127 
128 bool
GetStopOthers() const129 SBExpressionOptions::GetStopOthers () const
130 {
131     return m_opaque_ap->GetStopOthers ();
132 }
133 
134 void
SetStopOthers(bool run_others)135 SBExpressionOptions::SetStopOthers (bool run_others)
136 {
137     m_opaque_ap->SetStopOthers (run_others);
138 }
139 
140 bool
GetTrapExceptions() const141 SBExpressionOptions::GetTrapExceptions () const
142 {
143     return m_opaque_ap->GetTrapExceptions ();
144 }
145 
146 void
SetTrapExceptions(bool trap_exceptions)147 SBExpressionOptions::SetTrapExceptions (bool trap_exceptions)
148 {
149     m_opaque_ap->SetTrapExceptions (trap_exceptions);
150 }
151 
152 void
SetLanguage(lldb::LanguageType language)153 SBExpressionOptions::SetLanguage (lldb::LanguageType language)
154 {
155     m_opaque_ap->SetLanguage(language);
156 }
157 
158 void
SetCancelCallback(lldb::ExpressionCancelCallback callback,void * baton)159 SBExpressionOptions::SetCancelCallback (lldb::ExpressionCancelCallback callback, void *baton)
160 {
161     m_opaque_ap->SetCancelCallback (callback, baton);
162 }
163 
164 bool
GetGenerateDebugInfo()165 SBExpressionOptions::GetGenerateDebugInfo ()
166 {
167     return m_opaque_ap->GetGenerateDebugInfo();
168 }
169 
170 void
SetGenerateDebugInfo(bool b)171 SBExpressionOptions::SetGenerateDebugInfo (bool b)
172 {
173     return m_opaque_ap->SetGenerateDebugInfo(b);
174 }
175 
176 bool
GetSuppressPersistentResult()177 SBExpressionOptions::GetSuppressPersistentResult ()
178 {
179     return m_opaque_ap->GetResultIsInternal ();
180 }
181 
182 void
SetSuppressPersistentResult(bool b)183 SBExpressionOptions::SetSuppressPersistentResult (bool b)
184 {
185     return m_opaque_ap->SetResultIsInternal (b);
186 }
187 
188 const char *
GetPrefix() const189 SBExpressionOptions::GetPrefix () const
190 {
191     return m_opaque_ap->GetPrefix();
192 }
193 
194 void
SetPrefix(const char * prefix)195 SBExpressionOptions::SetPrefix (const char *prefix)
196 {
197     return m_opaque_ap->SetPrefix(prefix);
198 }
199 
200 EvaluateExpressionOptions *
get() const201 SBExpressionOptions::get() const
202 {
203     return m_opaque_ap.get();
204 }
205 
206 EvaluateExpressionOptions &
ref() const207 SBExpressionOptions::ref () const
208 {
209     return *(m_opaque_ap.get());
210 }
211