LLDB  mainline
SBExpressionOptions.cpp
Go to the documentation of this file.
1 //===-- SBExpressionOptions.cpp -------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
10 #include "SBReproducerPrivate.h"
11 #include "Utils.h"
12 #include "lldb/API/SBStream.h"
13 #include "lldb/Target/Target.h"
14 
15 using namespace lldb;
16 using namespace lldb_private;
17 
19  : m_opaque_up(new EvaluateExpressionOptions()) {
21 }
22 
24  : m_opaque_up() {
26  (const lldb::SBExpressionOptions &), rhs);
27 
29 }
30 
35  SBExpressionOptions, operator=,(const lldb::SBExpressionOptions &), rhs);
36 
37  if (this != &rhs)
39  return LLDB_RECORD_RESULT(*this);
40 }
41 
43 
47 
48  return m_opaque_up->DoesCoerceToId();
49 }
50 
53  coerce);
54 
55  m_opaque_up->SetCoerceToId(coerce);
56 }
57 
60 
61  return m_opaque_up->DoesUnwindOnError();
62 }
63 
66  unwind);
67 
68  m_opaque_up->SetUnwindOnError(unwind);
69 }
70 
74 
75  return m_opaque_up->DoesIgnoreBreakpoints();
76 }
77 
80  ignore);
81 
82  m_opaque_up->SetIgnoreBreakpoints(ignore);
83 }
84 
88 
89  return m_opaque_up->GetUseDynamic();
90 }
91 
94  (lldb::DynamicValueType), dynamic);
95 
96  m_opaque_up->SetUseDynamic(dynamic);
97 }
98 
102 
103  return m_opaque_up->GetTimeout() ? m_opaque_up->GetTimeout()->count() : 0;
104 }
105 
108  (uint32_t), timeout);
109 
110  m_opaque_up->SetTimeout(timeout == 0 ? Timeout<std::micro>(llvm::None)
111  : std::chrono::microseconds(timeout));
112 }
113 
117 
118  return m_opaque_up->GetOneThreadTimeout()
119  ? m_opaque_up->GetOneThreadTimeout()->count()
120  : 0;
121 }
122 
126 
127  m_opaque_up->SetOneThreadTimeout(timeout == 0
128  ? Timeout<std::micro>(llvm::None)
129  : std::chrono::microseconds(timeout));
130 }
131 
134 
135  return m_opaque_up->GetTryAllThreads();
136 }
137 
140  run_others);
141 
142  m_opaque_up->SetTryAllThreads(run_others);
143 }
144 
147 
148  return m_opaque_up->GetStopOthers();
149 }
150 
151 void SBExpressionOptions::SetStopOthers(bool run_others) {
153  run_others);
154 
155  m_opaque_up->SetStopOthers(run_others);
156 }
157 
161 
162  return m_opaque_up->GetTrapExceptions();
163 }
164 
165 void SBExpressionOptions::SetTrapExceptions(bool trap_exceptions) {
167  trap_exceptions);
168 
169  m_opaque_up->SetTrapExceptions(trap_exceptions);
170 }
171 
174  (lldb::LanguageType), language);
175 
176  m_opaque_up->SetLanguage(language);
177 }
178 
180  lldb::ExpressionCancelCallback callback, void *baton) {
182  (lldb::ExpressionCancelCallback, void *), callback, baton);
183 
184  m_opaque_up->SetCancelCallback(callback, baton);
185 }
186 
189 
190  return m_opaque_up->GetGenerateDebugInfo();
191 }
192 
195  b);
196 
197  return m_opaque_up->SetGenerateDebugInfo(b);
198 }
199 
203 
204  return m_opaque_up->GetResultIsInternal();
205 }
206 
209  (bool), b);
210 
211  return m_opaque_up->SetResultIsInternal(b);
212 }
213 
214 const char *SBExpressionOptions::GetPrefix() const {
216  GetPrefix);
217 
218  return m_opaque_up->GetPrefix();
219 }
220 
221 void SBExpressionOptions::SetPrefix(const char *prefix) {
222  LLDB_RECORD_METHOD(void, SBExpressionOptions, SetPrefix, (const char *),
223  prefix);
224 
225  return m_opaque_up->SetPrefix(prefix);
226 }
227 
230 
231  return m_opaque_up->GetAutoApplyFixIts();
232 }
233 
236 
237  return m_opaque_up->SetAutoApplyFixIts(b);
238 }
239 
243 
244  return m_opaque_up->GetRetriesWithFixIts();
245 }
246 
249  (uint64_t), retries);
250 
251  return m_opaque_up->SetRetriesWithFixIts(retries);
252 }
253 
256 
257  return m_opaque_up->GetExecutionPolicy() == eExecutionPolicyTopLevel;
258 }
259 
262 
263  m_opaque_up->SetExecutionPolicy(b ? eExecutionPolicyTopLevel
264  : m_opaque_up->default_execution_policy);
265 }
266 
269 
270  return m_opaque_up->GetExecutionPolicy() != eExecutionPolicyNever;
271 }
272 
274  LLDB_RECORD_METHOD(void, SBExpressionOptions, SetAllowJIT, (bool), allow);
275 
276  m_opaque_up->SetExecutionPolicy(allow ? m_opaque_up->default_execution_policy
278 }
279 
281  return m_opaque_up.get();
282 }
283 
285  return *(m_opaque_up.get());
286 }
287 
288 namespace lldb_private {
289 namespace repro {
290 
291 template <>
295  (const lldb::SBExpressionOptions &));
298  SBExpressionOptions, operator=,(const lldb::SBExpressionOptions &));
300  ());
302  (bool));
306  ());
308  (bool));
316  (uint32_t));
326  ());
332  (bool));
334  ());
336  (bool));
338  ());
339  LLDB_REGISTER_METHOD(void, SBExpressionOptions, SetPrefix, (const char *));
348  (uint64_t));
349 }
350 
351 }
352 }
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
A class that represents a running process on the host machine.
#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)
std::unique_ptr< lldb_private::EvaluateExpressionOptions > m_opaque_up
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)
void SetRetriesWithFixIts(uint64_t retries)
#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)