LLDB  mainline
UserExpression.cpp
Go to the documentation of this file.
1 //===-- UserExpression.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 
9 #include "lldb/Host/Config.h"
10 
11 #include <stdio.h>
12 #if HAVE_SYS_TYPES_H
13 #include <sys/types.h>
14 #endif
15 
16 #include <cstdlib>
17 #include <map>
18 #include <string>
19 
20 #include "lldb/Core/Module.h"
21 #include "lldb/Core/StreamFile.h"
29 #include "lldb/Host/HostInfo.h"
30 #include "lldb/Symbol/Block.h"
31 #include "lldb/Symbol/Function.h"
32 #include "lldb/Symbol/ObjectFile.h"
34 #include "lldb/Symbol/Type.h"
35 #include "lldb/Symbol/TypeSystem.h"
38 #include "lldb/Target/Process.h"
39 #include "lldb/Target/StackFrame.h"
40 #include "lldb/Target/Target.h"
41 #include "lldb/Target/ThreadPlan.h"
44 #include "lldb/Utility/Log.h"
46 
47 using namespace lldb_private;
48 
50 
52  llvm::StringRef expr, llvm::StringRef prefix,
53  lldb::LanguageType language,
54  ResultType desired_type,
55  const EvaluateExpressionOptions &options)
56  : Expression(exe_scope), m_expr_text(std::string(expr)),
57  m_expr_prefix(std::string(prefix)), m_language(language),
58  m_desired_type(desired_type), m_options(options) {}
59 
61 
63  m_jit_process_wp = exe_ctx.GetProcessSP();
64 
65  lldb::StackFrameSP frame_sp = exe_ctx.GetFrameSP();
66 
67  if (frame_sp)
68  m_address = frame_sp->GetFrameCodeAddress();
69 }
70 
72  lldb::TargetSP &target_sp,
73  lldb::ProcessSP &process_sp,
74  lldb::StackFrameSP &frame_sp) {
75  lldb::ProcessSP expected_process_sp = m_jit_process_wp.lock();
76  process_sp = exe_ctx.GetProcessSP();
77 
78  if (process_sp != expected_process_sp)
79  return false;
80 
81  process_sp = exe_ctx.GetProcessSP();
82  target_sp = exe_ctx.GetTargetSP();
83  frame_sp = exe_ctx.GetFrameSP();
84 
85  if (m_address.IsValid()) {
86  if (!frame_sp)
87  return false;
89  frame_sp->GetFrameCodeAddress(),
90  target_sp.get()) == 0);
91  }
92 
93  return true;
94 }
95 
97  lldb::TargetSP target_sp;
98  lldb::ProcessSP process_sp;
99  lldb::StackFrameSP frame_sp;
100 
101  return LockAndCheckContext(exe_ctx, target_sp, process_sp, frame_sp);
102 }
103 
104 lldb::addr_t UserExpression::GetObjectPointer(lldb::StackFrameSP frame_sp,
105  ConstString &object_name,
106  Status &err) {
107  err.Clear();
108 
109  if (!frame_sp) {
111  "Couldn't load '%s' because the context is incomplete",
112  object_name.AsCString());
113  return LLDB_INVALID_ADDRESS;
114  }
115 
116  lldb::VariableSP var_sp;
117  lldb::ValueObjectSP valobj_sp;
118 
119  valobj_sp = frame_sp->GetValueForVariableExpressionPath(
120  object_name.GetStringRef(), lldb::eNoDynamicValues,
125  var_sp, err);
126 
127  if (!err.Success() || !valobj_sp.get())
128  return LLDB_INVALID_ADDRESS;
129 
130  lldb::addr_t ret = valobj_sp->GetValueAsUnsigned(LLDB_INVALID_ADDRESS);
131 
132  if (ret == LLDB_INVALID_ADDRESS) {
134  "Couldn't load '%s' because its value couldn't be evaluated",
135  object_name.AsCString());
136  return LLDB_INVALID_ADDRESS;
137  }
138 
139  return ret;
140 }
141 
144  const EvaluateExpressionOptions &options,
145  llvm::StringRef expr, llvm::StringRef prefix,
146  lldb::ValueObjectSP &result_valobj_sp, Status &error,
147  std::string *fixed_expression, ValueObject *ctx_obj) {
150 
151  if (ctx_obj) {
152  static unsigned const ctx_type_mask =
153  lldb::TypeFlags::eTypeIsClass | lldb::TypeFlags::eTypeIsStructUnion;
154  if (!(ctx_obj->GetTypeInfo() & ctx_type_mask)) {
155  LLDB_LOG(log, "== [UserExpression::Evaluate] Passed a context object of "
156  "an invalid type, can't run expressions.");
157  error.SetErrorString("a context object of an invalid type passed");
159  }
160  }
161 
162  lldb_private::ExecutionPolicy execution_policy = options.GetExecutionPolicy();
163  lldb::LanguageType language = options.GetLanguage();
164  const ResultType desired_type = options.DoesCoerceToId()
168 
169  Target *target = exe_ctx.GetTargetPtr();
170  if (!target) {
171  LLDB_LOG(log, "== [UserExpression::Evaluate] Passed a NULL target, can't "
172  "run expressions.");
173  error.SetErrorString("expression passed a null target");
175  }
176 
177  Process *process = exe_ctx.GetProcessPtr();
178 
179  if (process == nullptr || process->GetState() != lldb::eStateStopped) {
180  if (execution_policy == eExecutionPolicyAlways) {
181  LLDB_LOG(log, "== [UserExpression::Evaluate] Expression may not run, but "
182  "is not constant ==");
183 
184  error.SetErrorString("expression needed to run but couldn't");
185 
186  return execution_results;
187  }
188  }
189 
190  // Explicitly force the IR interpreter to evaluate the expression when the
191  // there is no process that supports running the expression for us. Don't
192  // change the execution policy if we have the special top-level policy that
193  // doesn't contain any expression and there is nothing to interpret.
194  if (execution_policy != eExecutionPolicyTopLevel &&
195  (process == nullptr || !process->CanJIT()))
196  execution_policy = eExecutionPolicyNever;
197 
198  // We need to set the expression execution thread here, turns out parse can
199  // call functions in the process of looking up symbols, which will escape the
200  // context set by exe_ctx passed to Execute.
201  lldb::ThreadSP thread_sp = exe_ctx.GetThreadSP();
202  ThreadList::ExpressionExecutionThreadPusher execution_thread_pusher(
203  thread_sp);
204 
205  llvm::StringRef full_prefix;
206  llvm::StringRef option_prefix(options.GetPrefix());
207  std::string full_prefix_storage;
208  if (!prefix.empty() && !option_prefix.empty()) {
209  full_prefix_storage = std::string(prefix);
210  full_prefix_storage.append(std::string(option_prefix));
211  full_prefix = full_prefix_storage;
212  } else if (!prefix.empty())
213  full_prefix = prefix;
214  else
215  full_prefix = option_prefix;
216 
217  // If the language was not specified in the expression command, set it to the
218  // language in the target's properties if specified, else default to the
219  // langage for the frame.
220  if (language == lldb::eLanguageTypeUnknown) {
221  if (target->GetLanguage() != lldb::eLanguageTypeUnknown)
222  language = target->GetLanguage();
223  else if (StackFrame *frame = exe_ctx.GetFramePtr())
224  language = frame->GetLanguage();
225  }
226 
227  lldb::UserExpressionSP user_expression_sp(
228  target->GetUserExpressionForLanguage(expr, full_prefix, language,
229  desired_type, options, ctx_obj,
230  error));
231  if (error.Fail()) {
232  LLDB_LOG(log, "== [UserExpression::Evaluate] Getting expression: {0} ==",
233  error.AsCString());
235  }
236 
237  LLDB_LOG(log, "== [UserExpression::Evaluate] Parsing expression {0} ==",
238  expr.str());
239 
240  const bool keep_expression_in_memory = true;
241  const bool generate_debug_info = options.GetGenerateDebugInfo();
242 
244  error.SetErrorString("expression interrupted by callback before parse");
245  result_valobj_sp = ValueObjectConstResult::Create(
248  }
249 
250  DiagnosticManager diagnostic_manager;
251 
252  bool parse_success =
253  user_expression_sp->Parse(diagnostic_manager, exe_ctx, execution_policy,
254  keep_expression_in_memory, generate_debug_info);
255 
256  // Calculate the fixed expression always, since we need it for errors.
257  std::string tmp_fixed_expression;
258  if (fixed_expression == nullptr)
259  fixed_expression = &tmp_fixed_expression;
260 
261  const char *fixed_text = user_expression_sp->GetFixedText();
262  if (fixed_text != nullptr)
263  fixed_expression->append(fixed_text);
264 
265  // If there is a fixed expression, try to parse it:
266  if (!parse_success) {
267  // Delete the expression that failed to parse before attempting to parse
268  // the next expression.
269  user_expression_sp.reset();
270 
271  execution_results = lldb::eExpressionParseError;
272  if (fixed_expression && !fixed_expression->empty() &&
273  options.GetAutoApplyFixIts()) {
274  const uint64_t max_fix_retries = options.GetRetriesWithFixIts();
275  for (uint64_t i = 0; i < max_fix_retries; ++i) {
276  // Try parsing the fixed expression.
277  lldb::UserExpressionSP fixed_expression_sp(
279  fixed_expression->c_str(), full_prefix, language, desired_type,
280  options, ctx_obj, error));
281  DiagnosticManager fixed_diagnostic_manager;
282  parse_success = fixed_expression_sp->Parse(
283  fixed_diagnostic_manager, exe_ctx, execution_policy,
284  keep_expression_in_memory, generate_debug_info);
285  if (parse_success) {
286  diagnostic_manager.Clear();
287  user_expression_sp = fixed_expression_sp;
288  break;
289  } else {
290  // The fixed expression also didn't parse. Let's check for any new
291  // Fix-Its we could try.
292  if (fixed_expression_sp->GetFixedText()) {
293  *fixed_expression = fixed_expression_sp->GetFixedText();
294  } else {
295  // Fixed expression didn't compile without a fixit, don't retry and
296  // don't tell the user about it.
297  fixed_expression->clear();
298  break;
299  }
300  }
301  }
302  }
303 
304  if (!parse_success) {
305  std::string msg;
306  {
307  llvm::raw_string_ostream os(msg);
308  os << "expression failed to parse:\n";
309  if (!diagnostic_manager.Diagnostics().empty())
310  os << diagnostic_manager.GetString();
311  else
312  os << "unknown error";
313  if (target->GetEnableNotifyAboutFixIts() && fixed_expression &&
314  !fixed_expression->empty())
315  os << "\nfixed expression suggested:\n " << *fixed_expression;
316  }
317  error.SetExpressionError(execution_results, msg.c_str());
318  }
319  }
320 
321  if (parse_success) {
322  lldb::ExpressionVariableSP expr_result;
323 
324  if (execution_policy == eExecutionPolicyNever &&
325  !user_expression_sp->CanInterpret()) {
326  LLDB_LOG(log, "== [UserExpression::Evaluate] Expression may not run, but "
327  "is not constant ==");
328 
329  if (!diagnostic_manager.Diagnostics().size())
330  error.SetExpressionError(lldb::eExpressionSetupError,
331  "expression needed to run but couldn't");
332  } else if (execution_policy == eExecutionPolicyTopLevel) {
335  } else {
337  error.SetExpressionError(
339  "expression interrupted by callback before execution");
340  result_valobj_sp = ValueObjectConstResult::Create(
343  }
344 
345  diagnostic_manager.Clear();
346 
347  LLDB_LOG(log, "== [UserExpression::Evaluate] Executing expression ==");
348 
349  execution_results =
350  user_expression_sp->Execute(diagnostic_manager, exe_ctx, options,
351  user_expression_sp, expr_result);
352 
353  if (execution_results != lldb::eExpressionCompleted) {
354  LLDB_LOG(log, "== [UserExpression::Evaluate] Execution completed "
355  "abnormally ==");
356 
357  if (!diagnostic_manager.Diagnostics().size())
358  error.SetExpressionError(
359  execution_results, "expression failed to execute, unknown error");
360  else
361  error.SetExpressionError(execution_results,
362  diagnostic_manager.GetString().c_str());
363  } else {
364  if (expr_result) {
365  result_valobj_sp = expr_result->GetValueObject();
366  result_valobj_sp->SetPreferredDisplayLanguage(language);
367 
368  LLDB_LOG(log,
369  "== [UserExpression::Evaluate] Execution completed "
370  "normally with result {0} ==",
371  result_valobj_sp->GetValueAsCString());
372  } else {
373  LLDB_LOG(log, "== [UserExpression::Evaluate] Execution completed "
374  "normally with no result ==");
375 
377  }
378  }
379  }
380  }
381 
383  error.SetExpressionError(
385  "expression interrupted by callback after complete");
387  }
388 
389  if (result_valobj_sp.get() == nullptr) {
390  result_valobj_sp = ValueObjectConstResult::Create(
392  }
393 
394  return execution_results;
395 }
396 
399  ExecutionContext &exe_ctx,
400  const EvaluateExpressionOptions &options,
401  lldb::UserExpressionSP &shared_ptr_to_me,
402  lldb::ExpressionVariableSP &result_var) {
403  lldb::ExpressionResults expr_result = DoExecute(
404  diagnostic_manager, exe_ctx, options, shared_ptr_to_me, result_var);
405  Target *target = exe_ctx.GetTargetPtr();
406  if (options.GetResultIsInternal() && result_var && target) {
407  if (auto *persistent_state =
409  persistent_state->RemovePersistentVariable(result_var);
410  }
411  return expr_result;
412 }
lldb_private::UserExpression::InstallContext
void InstallContext(ExecutionContext &exe_ctx)
Populate m_in_cplusplus_method and m_in_objectivec_method based on the environment.
Definition: UserExpression.cpp:62
Block.h
lldb_private::UserExpression::m_address
Address m_address
The address the process is stopped in.
Definition: UserExpression.h:294
lldb_private::ExecutionContext
Definition: ExecutionContext.h:291
lldb_private::UserExpression::~UserExpression
~UserExpression() override
Destructor.
Definition: UserExpression.cpp:60
ExpressionVariable.h
lldb_private::ExecutionContext::GetThreadSP
const lldb::ThreadSP & GetThreadSP() const
Get accessor to get the thread shared pointer.
Definition: ExecutionContext.h:463
lldb_private::Address::IsValid
bool IsValid() const
Check if the object state is valid.
Definition: Address.h:332
lldb_private::ExecutionPolicy
ExecutionPolicy
Expression execution policies.
Definition: lldb-private-enumerations.h:144
lldb::eNoDynamicValues
@ eNoDynamicValues
Definition: lldb-enumerations.h:495
lldb_private::ExecutionContext::GetProcessPtr
Process * GetProcessPtr() const
Returns a pointer to the process object.
Definition: ExecutionContext.cpp:208
lldb::ExpressionResults
ExpressionResults
The results of expression evaluation.
Definition: lldb-enumerations.h:270
lldb_private::Expression::m_jit_process_wp
lldb::ProcessWP m_jit_process_wp
Expression's always have to have a target...
Definition: Expression.h:93
lldb_private::Process
Definition: Process.h:343
lldb_private::EvaluateExpressionOptions::DoesCoerceToId
bool DoesCoerceToId() const
Definition: Target.h:285
lldb_private::eExecutionPolicyNever
@ eExecutionPolicyNever
Definition: lldb-private-enumerations.h:146
lldb_private::EvaluateExpressionOptions::GetPrefix
const char * GetPrefix() const
Definition: Target.h:287
Module.h
lldb_private::EvaluateExpressionOptions
Definition: Target.h:255
lldb::LanguageType
LanguageType
Programming language type.
Definition: lldb-enumerations.h:436
lldb::eExpressionSetupError
@ eExpressionSetupError
Definition: lldb-enumerations.h:272
lldb_private::ExecutionContext::GetFramePtr
StackFrame * GetFramePtr() const
Returns a pointer to the frame object.
Definition: ExecutionContext.h:407
lldb_private::ConstString::AsCString
const char * AsCString(const char *value_if_empty=nullptr) const
Get the string value as a C string.
Definition: ConstString.h:193
UserExpression.h
StackFrame.h
lldb_private::UserExpression::Evaluate
static lldb::ExpressionResults Evaluate(ExecutionContext &exe_ctx, const EvaluateExpressionOptions &options, llvm::StringRef expr_cstr, llvm::StringRef expr_prefix, lldb::ValueObjectSP &result_valobj_sp, Status &error, std::string *fixed_expression=nullptr, ValueObject *ctx_obj=nullptr)
Evaluate one expression in the scratch context of the target passed in the exe_ctx and return its res...
Definition: UserExpression.cpp:143
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
lldb_private::eExecutionPolicyAlways
@ eExecutionPolicyAlways
Definition: lldb-private-enumerations.h:147
lldb_private::EvaluateExpressionOptions::GetAutoApplyFixIts
bool GetAutoApplyFixIts() const
Definition: Target.h:400
IRInterpreter.h
lldb_private::StackFrame::eExpressionPathOptionsNoFragileObjcIvar
@ eExpressionPathOptionsNoFragileObjcIvar
Definition: StackFrame.h:45
lldb_private::Target
Definition: Target.h:447
lldb_private::Process::GetState
lldb::StateType GetState()
Get accessor for the current process state.
Definition: Process.cpp:1273
lldb_private::DiagnosticManager::GetString
std::string GetString(char separator='\n')
Definition: DiagnosticManager.cpp:47
Process.h
lldb_private::eExecutionPolicyTopLevel
@ eExecutionPolicyTopLevel
Definition: lldb-private-enumerations.h:148
lldb_private::EvaluateExpressionOptions::GetGenerateDebugInfo
bool GetGenerateDebugInfo() const
Definition: Target.h:349
lldb_private::Process::CanJIT
bool CanJIT()
Determines whether executing JIT-compiled code in this process is possible.
Definition: Process.cpp:2306
lldb_private::Expression::ResultType
ResultType
Definition: Expression.h:35
lldb::eStateStopped
@ eStateStopped
Process or thread is stopped and can be examined.
Definition: lldb-enumerations.h:84
Target.h
LIBLLDB_LOG_EXPRESSIONS
#define LIBLLDB_LOG_EXPRESSIONS
Definition: Logging.h:22
error
static llvm::raw_ostream & error(Stream &strm)
Definition: CommandReturnObject.cpp:17
lldb_private::Status::Success
bool Success() const
Test for success condition.
Definition: Status.cpp:288
lldb_private::ConstString::GetStringRef
llvm::StringRef GetStringRef() const
Get the string value as a llvm::StringRef.
Definition: ConstString.h:202
Log.h
lldb_private::ExecutionContextScope
Definition: ExecutionContextScope.h:32
lldb_private::StackFrame::eExpressionPathOptionCheckPtrVsMember
@ eExpressionPathOptionCheckPtrVsMember
Definition: StackFrame.h:44
lldb::eExpressionCompleted
@ eExpressionCompleted
Definition: lldb-enumerations.h:271
lldb_private::Status::SetErrorStringWithFormat
int SetErrorStringWithFormat(const char *format,...) __attribute__((format(printf
Set the current error string to a formatted error string.
Definition: Status.cpp:256
StreamString.h
Type.h
lldb_private::ConstString
Definition: ConstString.h:40
lldb::eExpressionEvaluationComplete
@ eExpressionEvaluationComplete
Definition: lldb-enumerations.h:958
lldb_private::UserExpression::GetObjectPointer
static lldb::addr_t GetObjectPointer(lldb::StackFrameSP frame_sp, ConstString &object_name, Status &err)
Definition: UserExpression.cpp:104
lldb_private::StackFrame::eExpressionPathOptionsNoSyntheticArrayRange
@ eExpressionPathOptionsNoSyntheticArrayRange
Definition: StackFrame.h:47
lldb::eErrorTypeGeneric
@ eErrorTypeGeneric
Generic errors that can be any value.
Definition: lldb-enumerations.h:308
lldb::eExpressionEvaluationParse
@ eExpressionEvaluationParse
Definition: lldb-enumerations.h:955
IRExecutionUnit.h
HostInfo.h
lldb_private::Target::GetPersistentExpressionStateForLanguage
PersistentExpressionState * GetPersistentExpressionStateForLanguage(lldb::LanguageType language)
Definition: Target.cpp:2261
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:38
TypeSystem.h
lldb::eExpressionInterrupted
@ eExpressionInterrupted
Definition: lldb-enumerations.h:275
lldb_private::Address::CompareLoadAddress
static int CompareLoadAddress(const Address &lhs, const Address &rhs, Target *target)
Definition: Address.cpp:905
VariableList.h
ObjectFile.h
lldb_private::ThreadList::ExpressionExecutionThreadPusher
Definition: ThreadList.h:47
ValueObjectConstResult.h
ThreadPlan.h
lldb_private::StackFrame::eExpressionPathOptionsNoSyntheticChildren
@ eExpressionPathOptionsNoSyntheticChildren
Definition: StackFrame.h:46
StreamFile.h
lldb_private::ExecutionContext::GetProcessSP
const lldb::ProcessSP & GetProcessSP() const
Get accessor to get the process shared pointer.
Definition: ExecutionContext.h:458
lldb_private::DiagnosticManager::Diagnostics
const DiagnosticList & Diagnostics()
Definition: DiagnosticManager.h:100
Materializer.h
lldb_private::Status
Definition: Status.h:44
lldb_private::ValueObject
ValueObject:
Definition: ValueObject.h:105
lldb_private::EvaluateExpressionOptions::GetLanguage
lldb::LanguageType GetLanguage() const
Definition: Target.h:281
lldb::eLanguageTypeUnknown
@ eLanguageTypeUnknown
Unknown or invalid language value.
Definition: lldb-enumerations.h:437
lldb_private::ExecutionContext::GetBestExecutionContextScope
ExecutionContextScope * GetBestExecutionContextScope() const
Definition: ExecutionContext.cpp:216
lldb_private::UserExpression::m_language
lldb::LanguageType m_language
The language to use when parsing (eLanguageTypeUnknown means use defaults)
Definition: UserExpression.h:301
lldb_private::ExecutionContext::GetFrameSP
const lldb::StackFrameSP & GetFrameSP() const
Get accessor to get the frame shared pointer.
Definition: ExecutionContext.h:468
ThreadPlanCallUserExpression.h
lldb_private::DiagnosticManager
Definition: DiagnosticManager.h:93
lldb_private::Expression::eResultTypeAny
@ eResultTypeAny
Definition: Expression.h:35
lldb_private::ValueObject::GetTypeInfo
virtual uint32_t GetTypeInfo(CompilerType *pointee_or_element_compiler_type=nullptr)
Definition: ValueObject.h:378
lldb_private::UserExpression::Execute
lldb::ExpressionResults Execute(DiagnosticManager &diagnostic_manager, ExecutionContext &exe_ctx, const EvaluateExpressionOptions &options, lldb::UserExpressionSP &shared_ptr_to_me, lldb::ExpressionVariableSP &result)
Execute the parsed expression by callinng the derived class's DoExecute method.
Definition: UserExpression.cpp:398
LLDB_INVALID_ADDRESS
#define LLDB_INVALID_ADDRESS
Invalid value definitions.
Definition: lldb-defines.h:85
lldb_private::ExecutionContext::GetTargetSP
const lldb::TargetSP & GetTargetSP() const
Get accessor to get the target shared pointer.
Definition: ExecutionContext.h:453
LLDB_LOG
#define LLDB_LOG(log,...)
The LLDB_LOG* macros defined below are the way to emit log messages.
Definition: Log.h:242
Function.h
lldb_private::ValueObjectConstResult::Create
static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, lldb::ByteOrder byte_order, uint32_t addr_byte_size, lldb::addr_t address=LLDB_INVALID_ADDRESS)
Definition: ValueObjectConstResult.cpp:28
lldb_private::UserExpression::kNoResult
static const Status::ValueType kNoResult
ValueObject::GetError() returns this if there is no result from the expression.
Definition: UserExpression.h:265
lldb_private::Target::GetUserExpressionForLanguage
UserExpression * GetUserExpressionForLanguage(llvm::StringRef expr, llvm::StringRef prefix, lldb::LanguageType language, Expression::ResultType desired_type, const EvaluateExpressionOptions &options, ValueObject *ctx_obj, Status &error)
Definition: Target.cpp:2275
DiagnosticManager.h
lldb_private::DiagnosticManager::Clear
void Clear()
Definition: DiagnosticManager.h:95
lldb_private::UserExpression::UserExpression
UserExpression(ExecutionContextScope &exe_scope, llvm::StringRef expr, llvm::StringRef prefix, lldb::LanguageType language, ResultType desired_type, const EvaluateExpressionOptions &options)
Constructor.
Definition: UserExpression.cpp:51
lldb_private::EvaluateExpressionOptions::GetExecutionPolicy
ExecutionPolicy GetExecutionPolicy() const
Definition: Target.h:275
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::TargetProperties::GetLanguage
lldb::LanguageType GetLanguage() const
Definition: Target.cpp:4145
LIBLLDB_LOG_STEP
#define LIBLLDB_LOG_STEP
Definition: Logging.h:21
lldb_private::EvaluateExpressionOptions::GetResultIsInternal
bool GetResultIsInternal() const
Definition: Target.h:396
lldb_private::TargetProperties::GetEnableNotifyAboutFixIts
bool GetEnableNotifyAboutFixIts() const
Definition: Target.cpp:4073
lldb_private::UserExpression::ID
static char ID
LLVM RTTI support.
Definition: UserExpression.h:37
lldb_private::Status::Clear
void Clear()
Clear the object state.
Definition: Status.cpp:168
ConstString.h
lldb_private::EvaluateExpressionOptions::InvokeCancelCallback
bool InvokeCancelCallback(lldb::ExpressionEvaluationPhase phase) const
Definition: Target.h:370
lldb_private::UserExpression::LockAndCheckContext
bool LockAndCheckContext(ExecutionContext &exe_ctx, lldb::TargetSP &target_sp, lldb::ProcessSP &process_sp, lldb::StackFrameSP &frame_sp)
Definition: UserExpression.cpp:71
lldb::eExpressionParseError
@ eExpressionParseError
Definition: lldb-enumerations.h:273
lldb_private::Log
Definition: Log.h:49
lldb_private::GetLogIfAnyCategoriesSet
Log * GetLogIfAnyCategoriesSet(uint32_t mask)
Definition: Logging.cpp:62
SymbolVendor.h
lldb_private::EvaluateExpressionOptions::GetRetriesWithFixIts
uint64_t GetRetriesWithFixIts() const
Definition: Target.h:406
lldb_private::StackFrame
Definition: StackFrame.h:40
lldb_private::Expression
Definition: Expression.h:33
lldb::eExpressionEvaluationExecution
@ eExpressionEvaluationExecution
Definition: lldb-enumerations.h:957
lldb_private::UserExpression::DoExecute
virtual lldb::ExpressionResults DoExecute(DiagnosticManager &diagnostic_manager, ExecutionContext &exe_ctx, const EvaluateExpressionOptions &options, lldb::UserExpressionSP &shared_ptr_to_me, lldb::ExpressionVariableSP &result)=0
lldb_private::Expression::eResultTypeId
@ eResultTypeId
Definition: Expression.h:35
lldb_private::ExecutionContext::GetTargetPtr
Target * GetTargetPtr() const
Returns a pointer to the target object.
Definition: ExecutionContext.cpp:200
ExecutionContext.h
lldb_private::UserExpression::MatchesContext
bool MatchesContext(ExecutionContext &exe_ctx)
Definition: UserExpression.cpp:96