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 "Utils.h"
11#include "lldb/API/SBStream.h"
12#include "lldb/Target/Target.h"
14
15using namespace lldb;
16using namespace lldb_private;
17
19 : m_opaque_up(new EvaluateExpressionOptions()) {
21}
22
24 LLDB_INSTRUMENT_VA(this, rhs);
25
27}
28
31 LLDB_INSTRUMENT_VA(this, rhs);
32
33 if (this != &rhs)
35 return *this;
36}
37
39
42
43 return m_opaque_up->DoesCoerceToId();
44}
45
47 LLDB_INSTRUMENT_VA(this, coerce);
48
49 m_opaque_up->SetCoerceToId(coerce);
50}
51
54
55 return m_opaque_up->DoesUnwindOnError();
56}
57
59 LLDB_INSTRUMENT_VA(this, unwind);
60
61 m_opaque_up->SetUnwindOnError(unwind);
62}
63
66
67 return m_opaque_up->DoesIgnoreBreakpoints();
68}
69
71 LLDB_INSTRUMENT_VA(this, ignore);
72
73 m_opaque_up->SetIgnoreBreakpoints(ignore);
74}
75
78
79 return m_opaque_up->GetUseDynamic();
80}
81
83 LLDB_INSTRUMENT_VA(this, dynamic);
84
85 m_opaque_up->SetUseDynamic(dynamic);
86}
87
90
91 return m_opaque_up->GetTimeout() ? m_opaque_up->GetTimeout()->count() : 0;
92}
93
95 LLDB_INSTRUMENT_VA(this, timeout);
96
97 m_opaque_up->SetTimeout(timeout == 0 ? Timeout<std::micro>(std::nullopt)
98 : std::chrono::microseconds(timeout));
99}
100
102 LLDB_INSTRUMENT_VA(this);
103
104 return m_opaque_up->GetOneThreadTimeout()
105 ? m_opaque_up->GetOneThreadTimeout()->count()
106 : 0;
107}
108
110 LLDB_INSTRUMENT_VA(this, timeout);
111
112 m_opaque_up->SetOneThreadTimeout(timeout == 0
113 ? Timeout<std::micro>(std::nullopt)
114 : std::chrono::microseconds(timeout));
115}
116
118 LLDB_INSTRUMENT_VA(this);
119
120 return m_opaque_up->GetTryAllThreads();
121}
122
124 LLDB_INSTRUMENT_VA(this, run_others);
125
126 m_opaque_up->SetTryAllThreads(run_others);
127}
128
130 LLDB_INSTRUMENT_VA(this);
131
132 return m_opaque_up->GetStopOthers();
133}
134
136 LLDB_INSTRUMENT_VA(this, run_others);
137
138 m_opaque_up->SetStopOthers(run_others);
139}
140
142 LLDB_INSTRUMENT_VA(this);
143
144 return m_opaque_up->GetTrapExceptions();
145}
146
147void SBExpressionOptions::SetTrapExceptions(bool trap_exceptions) {
148 LLDB_INSTRUMENT_VA(this, trap_exceptions);
149
150 m_opaque_up->SetTrapExceptions(trap_exceptions);
151}
152
154 LLDB_INSTRUMENT_VA(this, language);
155
156 m_opaque_up->SetLanguage(language);
157}
158
160 lldb::ExpressionCancelCallback callback, void *baton) {
161 LLDB_INSTRUMENT_VA(this, callback, baton);
162
163 m_opaque_up->SetCancelCallback(callback, baton);
164}
165
167 LLDB_INSTRUMENT_VA(this);
168
169 return m_opaque_up->GetGenerateDebugInfo();
170}
171
173 LLDB_INSTRUMENT_VA(this, b);
174
175 return m_opaque_up->SetGenerateDebugInfo(b);
176}
177
179 LLDB_INSTRUMENT_VA(this);
180
181 return m_opaque_up->GetSuppressPersistentResult();
182}
183
185 LLDB_INSTRUMENT_VA(this, b);
186
187 return m_opaque_up->SetSuppressPersistentResult(b);
188}
189
191 LLDB_INSTRUMENT_VA(this);
192
193 return ConstString(m_opaque_up->GetPrefix()).GetCString();
194}
195
196void SBExpressionOptions::SetPrefix(const char *prefix) {
197 LLDB_INSTRUMENT_VA(this, prefix);
198
199 return m_opaque_up->SetPrefix(prefix);
200}
201
203 LLDB_INSTRUMENT_VA(this);
204
205 return m_opaque_up->GetAutoApplyFixIts();
206}
207
209 LLDB_INSTRUMENT_VA(this, b);
210
211 return m_opaque_up->SetAutoApplyFixIts(b);
212}
213
215 LLDB_INSTRUMENT_VA(this);
216
217 return m_opaque_up->GetRetriesWithFixIts();
218}
219
221 LLDB_INSTRUMENT_VA(this, retries);
222
223 return m_opaque_up->SetRetriesWithFixIts(retries);
224}
225
227 LLDB_INSTRUMENT_VA(this);
228
229 return m_opaque_up->GetExecutionPolicy() == eExecutionPolicyTopLevel;
230}
231
233 LLDB_INSTRUMENT_VA(this, b);
234
235 m_opaque_up->SetExecutionPolicy(b ? eExecutionPolicyTopLevel
236 : m_opaque_up->default_execution_policy);
237}
238
240 LLDB_INSTRUMENT_VA(this);
241
242 return m_opaque_up->GetExecutionPolicy() != eExecutionPolicyNever;
243}
244
246 LLDB_INSTRUMENT_VA(this, allow);
247
248 m_opaque_up->SetExecutionPolicy(allow ? m_opaque_up->default_execution_policy
250}
251
253 return m_opaque_up.get();
254}
255
257 return *m_opaque_up;
258}
#define LLDB_INSTRUMENT_VA(...)
void SetCancelCallback(lldb::ExpressionCancelCallback callback, void *baton)
void SetFetchDynamicValue(lldb::DynamicValueType dynamic=lldb::eDynamicCanRunTarget)
void SetLanguage(lldb::LanguageType language)
const char * GetPrefix() const
lldb_private::EvaluateExpressionOptions & ref() const
void SetSuppressPersistentResult(bool b=false)
void SetTryAllThreads(bool run_others=true)
void SetRetriesWithFixIts(uint64_t retries)
std::unique_ptr< lldb_private::EvaluateExpressionOptions > m_opaque_up
void SetTrapExceptions(bool trap_exceptions=true)
void SetTimeoutInMicroSeconds(uint32_t timeout=0)
void SetStopOthers(bool stop_others=true)
void SetIgnoreBreakpoints(bool ignore=true)
void SetOneThreadTimeoutInMicroSeconds(uint32_t timeout=0)
uint32_t GetTimeoutInMicroSeconds() const
void SetCoerceResultToId(bool coerce=true)
void SetGenerateDebugInfo(bool b=true)
void SetAutoApplyFixIts(bool b=true)
const SBExpressionOptions & operator=(const lldb::SBExpressionOptions &rhs)
lldb_private::EvaluateExpressionOptions * get() const
void SetUnwindOnError(bool unwind=true)
lldb::DynamicValueType GetFetchDynamicValue() const
void SetPrefix(const char *prefix)
uint32_t GetOneThreadTimeoutInMicroSeconds() const
A uniqued constant string class.
Definition: ConstString.h:40
const char * GetCString() const
Get the string value as a C string.
Definition: ConstString.h:214
A class that represents a running process on the host machine.
Definition: SBAttachInfo.h:14
std::unique_ptr< T > clone(const std::unique_ptr< T > &src)
Definition: Utils.h:17
Definition: SBAddress.h:15
LanguageType
Programming language type.
bool(* ExpressionCancelCallback)(ExpressionEvaluationPhase phase, void *baton)
Definition: lldb-types.h:74