LLDB  mainline
SBExpressionOptions.cpp
Go to the documentation of this file.
1 //===-- SBExpressionOptions.cpp ---------------------------------------------*-
2 //C++ -*-===//
3 //
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //
8 //===----------------------------------------------------------------------===//
9 
11 #include "SBReproducerPrivate.h"
12 #include "Utils.h"
13 #include "lldb/API/SBStream.h"
14 #include "lldb/Target/Target.h"
15 
16 using namespace lldb;
17 using namespace lldb_private;
18 
20  : m_opaque_up(new EvaluateExpressionOptions()) {
22 }
23 
25  : m_opaque_up() {
27  (const lldb::SBExpressionOptions &), rhs);
28 
29  m_opaque_up = clone(rhs.m_opaque_up);
30 }
31 
36  SBExpressionOptions, operator=,(const lldb::SBExpressionOptions &), rhs);
37 
38  if (this != &rhs)
39  m_opaque_up = clone(rhs.m_opaque_up);
40  return LLDB_RECORD_RESULT(*this);
41 }
42 
44 
48 
49  return m_opaque_up->DoesCoerceToId();
50 }
51 
54  coerce);
55 
56  m_opaque_up->SetCoerceToId(coerce);
57 }
58 
61 
62  return m_opaque_up->DoesUnwindOnError();
63 }
64 
67  unwind);
68 
69  m_opaque_up->SetUnwindOnError(unwind);
70 }
71 
75 
76  return m_opaque_up->DoesIgnoreBreakpoints();
77 }
78 
81  ignore);
82 
83  m_opaque_up->SetIgnoreBreakpoints(ignore);
84 }
85 
89 
90  return m_opaque_up->GetUseDynamic();
91 }
92 
95  (lldb::DynamicValueType), dynamic);
96 
97  m_opaque_up->SetUseDynamic(dynamic);
98 }
99 
103 
104  return m_opaque_up->GetTimeout() ? m_opaque_up->GetTimeout()->count() : 0;
105 }
106 
109  (uint32_t), timeout);
110 
111  m_opaque_up->SetTimeout(timeout == 0 ? Timeout<std::micro>(llvm::None)
112  : std::chrono::microseconds(timeout));
113 }
114 
118 
119  return m_opaque_up->GetOneThreadTimeout()
120  ? m_opaque_up->GetOneThreadTimeout()->count()
121  : 0;
122 }
123 
127 
128  m_opaque_up->SetOneThreadTimeout(timeout == 0
129  ? Timeout<std::micro>(llvm::None)
130  : std::chrono::microseconds(timeout));
131 }
132 
135 
136  return m_opaque_up->GetTryAllThreads();
137 }
138 
141  run_others);
142 
143  m_opaque_up->SetTryAllThreads(run_others);
144 }
145 
148 
149  return m_opaque_up->GetStopOthers();
150 }
151 
152 void SBExpressionOptions::SetStopOthers(bool run_others) {
154  run_others);
155 
156  m_opaque_up->SetStopOthers(run_others);
157 }
158 
162 
163  return m_opaque_up->GetTrapExceptions();
164 }
165 
166 void SBExpressionOptions::SetTrapExceptions(bool trap_exceptions) {
168  trap_exceptions);
169 
170  m_opaque_up->SetTrapExceptions(trap_exceptions);
171 }
172 
175  (lldb::LanguageType), language);
176 
177  m_opaque_up->SetLanguage(language);
178 }
179 
181  lldb::ExpressionCancelCallback callback, void *baton) {
183  (lldb::ExpressionCancelCallback, void *), callback, baton);
184 
185  m_opaque_up->SetCancelCallback(callback, baton);
186 }
187 
190 
191  return m_opaque_up->GetGenerateDebugInfo();
192 }
193 
196  b);
197 
198  return m_opaque_up->SetGenerateDebugInfo(b);
199 }
200 
204 
205  return m_opaque_up->GetResultIsInternal();
206 }
207 
210  (bool), b);
211 
212  return m_opaque_up->SetResultIsInternal(b);
213 }
214 
215 const char *SBExpressionOptions::GetPrefix() const {
217  GetPrefix);
218 
219  return m_opaque_up->GetPrefix();
220 }
221 
222 void SBExpressionOptions::SetPrefix(const char *prefix) {
223  LLDB_RECORD_METHOD(void, SBExpressionOptions, SetPrefix, (const char *),
224  prefix);
225 
226  return m_opaque_up->SetPrefix(prefix);
227 }
228 
231 
232  return m_opaque_up->GetAutoApplyFixIts();
233 }
234 
237 
238  return m_opaque_up->SetAutoApplyFixIts(b);
239 }
240 
243 
244  return m_opaque_up->GetExecutionPolicy() == eExecutionPolicyTopLevel;
245 }
246 
249 
250  m_opaque_up->SetExecutionPolicy(b ? eExecutionPolicyTopLevel
251  : m_opaque_up->default_execution_policy);
252 }
253 
256 
257  return m_opaque_up->GetExecutionPolicy() != eExecutionPolicyNever;
258 }
259 
261  LLDB_RECORD_METHOD(void, SBExpressionOptions, SetAllowJIT, (bool), allow);
262 
263  m_opaque_up->SetExecutionPolicy(allow ? m_opaque_up->default_execution_policy
265 }
266 
268  return m_opaque_up.get();
269 }
270 
272  return *(m_opaque_up.get());
273 }
274 
275 namespace lldb_private {
276 namespace repro {
277 
278 template <>
282  (const lldb::SBExpressionOptions &));
285  SBExpressionOptions, operator=,(const lldb::SBExpressionOptions &));
287  ());
289  (bool));
293  ());
295  (bool));
303  (uint32_t));
313  ());
319  (bool));
321  ());
323  (bool));
325  ());
326  LLDB_REGISTER_METHOD(void, SBExpressionOptions, SetPrefix, (const char *));
333 }
334 
335 }
336 }
void SetTimeoutInMicroSeconds(uint32_t timeout=0)
The registry contains a unique mapping between functions and their ID.
uint32_t GetTimeoutInMicroSeconds() const
lldb_private::EvaluateExpressionOptions & ref() const
Enumerations for broadcasting.
Definition: SBLaunchInfo.h:14
#define LLDB_RECORD_CONSTRUCTOR_NO_ARGS(Class)
const char * GetPrefix() const
void SetTryAllThreads(bool run_others=true)
#define LLDB_RECORD_DUMMY(Result, Class, Method, Signature,...)
The LLDB_RECORD_DUMMY macro is special because it doesn&#39;t actually record anything.
void SetTrapExceptions(bool trap_exceptions=true)
void SetCoerceResultToId(bool coerce=true)
void RegisterMethods< SBExpressionOptions >(Registry &R)
#define LLDB_REGISTER_CONSTRUCTOR(Class, Signature)
#define LLDB_RECORD_METHOD_NO_ARGS(Result, Class, Method)
LanguageType
Programming language type.
void SetCancelCallback(lldb::ExpressionCancelCallback callback, void *baton)
std::unique_ptr< T > clone(const std::unique_ptr< T > &src)
Definition: Utils.h:17
uint32_t GetOneThreadTimeoutInMicroSeconds() const
void SetStopOthers(bool stop_others=true)
#define LLDB_RECORD_CONSTRUCTOR(Class, Signature,...)
const SBExpressionOptions & operator=(const lldb::SBExpressionOptions &rhs)
#define LLDB_RECORD_METHOD(Result, Class, Method, Signature,...)
lldb::DynamicValueType GetFetchDynamicValue() const
void SetLanguage(lldb::LanguageType language)
bool(* ExpressionCancelCallback)(ExpressionEvaluationPhase phase, void *baton)
Definition: lldb-types.h:74
void SetGenerateDebugInfo(bool b=true)
void SetPrefix(const char *prefix)
Definition: SBAddress.h:15
void SetIgnoreBreakpoints(bool ignore=true)
void SetOneThreadTimeoutInMicroSeconds(uint32_t timeout=0)
lldb_private::EvaluateExpressionOptions * get() const
#define LLDB_REGISTER_METHOD(Result, Class, Method, Signature)
void SetAutoApplyFixIts(bool b=true)
void SetFetchDynamicValue(lldb::DynamicValueType dynamic=lldb::eDynamicCanRunTarget)
#define LLDB_RECORD_METHOD_CONST_NO_ARGS(Result, Class, Method)
#define LLDB_RECORD_RESULT(Result)
void SetSuppressPersistentResult(bool b=false)
#define LLDB_REGISTER_METHOD_CONST(Result, Class, Method, Signature)
void SetUnwindOnError(bool unwind=true)