本文整理汇总了C++中EvaluateExpressionOptions::GetUseDynamic方法的典型用法代码示例。如果您正苦于以下问题:C++ EvaluateExpressionOptions::GetUseDynamic方法的具体用法?C++ EvaluateExpressionOptions::GetUseDynamic怎么用?C++ EvaluateExpressionOptions::GetUseDynamic使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EvaluateExpressionOptions
的用法示例。
在下文中一共展示了EvaluateExpressionOptions::GetUseDynamic方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ExpressionVariable
lldb::ExpressionResults
GoUserExpression::DoExecute(DiagnosticManager &diagnostic_manager,
ExecutionContext &exe_ctx,
const EvaluateExpressionOptions &options,
lldb::UserExpressionSP &shared_ptr_to_me,
lldb::ExpressionVariableSP &result) {
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_EXPRESSIONS |
LIBLLDB_LOG_STEP));
lldb_private::ExecutionPolicy execution_policy = options.GetExecutionPolicy();
lldb::ExpressionResults execution_results = lldb::eExpressionSetupError;
Process *process = exe_ctx.GetProcessPtr();
Target *target = exe_ctx.GetTargetPtr();
if (target == nullptr || process == nullptr ||
process->GetState() != lldb::eStateStopped) {
if (execution_policy == eExecutionPolicyAlways) {
if (log)
log->Printf("== [GoUserExpression::Evaluate] Expression may not run, "
"but is not constant ==");
diagnostic_manager.PutCString(eDiagnosticSeverityError,
"expression needed to run but couldn't");
return execution_results;
}
}
m_interpreter->set_use_dynamic(options.GetUseDynamic());
ValueObjectSP result_val_sp = m_interpreter->Evaluate(exe_ctx);
Error err = m_interpreter->error();
m_interpreter.reset();
if (!result_val_sp) {
const char *error_cstr = err.AsCString();
if (error_cstr && error_cstr[0])
diagnostic_manager.PutCString(eDiagnosticSeverityError, error_cstr);
else
diagnostic_manager.PutCString(eDiagnosticSeverityError,
"expression can't be interpreted or run");
return lldb::eExpressionDiscarded;
}
result.reset(new ExpressionVariable(ExpressionVariable::eKindGo));
result->m_live_sp = result->m_frozen_sp = result_val_sp;
result->m_flags |= ExpressionVariable::EVIsProgramReference;
PersistentExpressionState *pv =
target->GetPersistentExpressionStateForLanguage(eLanguageTypeGo);
if (pv != nullptr) {
result->SetName(pv->GetNextPersistentVariableName());
pv->AddVariable(result);
}
return lldb::eExpressionCompleted;
}