本文整理汇总了C++中EvaluateExpressionOptions::SetRunOthers方法的典型用法代码示例。如果您正苦于以下问题:C++ EvaluateExpressionOptions::SetRunOthers方法的具体用法?C++ EvaluateExpressionOptions::SetRunOthers怎么用?C++ EvaluateExpressionOptions::SetRunOthers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EvaluateExpressionOptions
的用法示例。
在下文中一共展示了EvaluateExpressionOptions::SetRunOthers方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: evaluation_locker
bool
BreakpointLocation::ConditionSaysStop (ExecutionContext &exe_ctx, Error &error)
{
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_BREAKPOINTS);
Mutex::Locker evaluation_locker(m_condition_mutex);
size_t condition_hash;
const char *condition_text = GetConditionText(&condition_hash);
if (!condition_text)
{
m_user_expression_sp.reset();
return false;
}
if (condition_hash != m_condition_hash ||
!m_user_expression_sp ||
!m_user_expression_sp->MatchesContext(exe_ctx))
{
m_user_expression_sp.reset(new ClangUserExpression(condition_text,
NULL,
lldb::eLanguageTypeUnknown,
ClangUserExpression::eResultTypeAny));
StreamString errors;
if (!m_user_expression_sp->Parse(errors,
exe_ctx,
eExecutionPolicyOnlyWhenNeeded,
true))
{
error.SetErrorStringWithFormat("Couldn't parse conditional expression:\n%s",
errors.GetData());
m_user_expression_sp.reset();
return false;
}
m_condition_hash = condition_hash;
}
// We need to make sure the user sees any parse errors in their condition, so we'll hook the
// constructor errors up to the debugger's Async I/O.
ValueObjectSP result_value_sp;
EvaluateExpressionOptions options;
options.SetUnwindOnError(true);
options.SetIgnoreBreakpoints(true);
options.SetRunOthers(true);
Error expr_error;
StreamString execution_errors;
ClangExpressionVariableSP result_variable_sp;
ExecutionResults result_code =
m_user_expression_sp->Execute(execution_errors,
exe_ctx,
options,
m_user_expression_sp,
result_variable_sp);
bool ret;
if (result_code == eExecutionCompleted)
{
if (!result_variable_sp)
{
ret = false;
error.SetErrorString("Expression did not return a result");
return false;
}
result_value_sp = result_variable_sp->GetValueObject();
if (result_value_sp)
{
Scalar scalar_value;
if (result_value_sp->ResolveValue (scalar_value))
{
if (scalar_value.ULongLong(1) == 0)
ret = false;
else
ret = true;
if (log)
log->Printf("Condition successfully evaluated, result is %s.\n",
ret ? "true" : "false");
}
else
{
ret = false;
error.SetErrorString("Failed to get an integer result from the expression");
}
}
else
{
ret = false;
error.SetErrorString("Failed to get any result from the expression");
//.........这里部分代码省略.........