forked from OSchip/llvm-project
In cases where you'd use an expression to get a value to insert in a command, be ready to use synthetic children if they are there. Those are now a source of values, so worth checking for
llvm-svn: 219452
This commit is contained in:
parent
32cac2e062
commit
ca0e5ad3d3
|
@ -871,15 +871,18 @@ Args::StringToAddress (const ExecutionContext *exe_ctx, const char *s, lldb::add
|
|||
options.SetTryAllThreads(true);
|
||||
|
||||
ExpressionResults expr_result = target->EvaluateExpression(s,
|
||||
exe_ctx->GetFramePtr(),
|
||||
valobj_sp,
|
||||
options);
|
||||
exe_ctx->GetFramePtr(),
|
||||
valobj_sp,
|
||||
options);
|
||||
|
||||
bool success = false;
|
||||
if (expr_result == eExpressionCompleted)
|
||||
{
|
||||
if (valobj_sp)
|
||||
valobj_sp = valobj_sp->GetQualifiedRepresentationIfAvailable(valobj_sp->GetDynamicValueType(), true);
|
||||
// Get the address to watch.
|
||||
addr = valobj_sp->GetValueAsUnsigned(fail_value, &success);
|
||||
if (valobj_sp)
|
||||
addr = valobj_sp->GetValueAsUnsigned(fail_value, &success);
|
||||
if (success)
|
||||
{
|
||||
if (error_ptr)
|
||||
|
|
|
@ -1466,13 +1466,15 @@ CommandInterpreter::PreprocessCommand (std::string &command)
|
|||
options.SetTimeoutUsec(0);
|
||||
|
||||
ExpressionResults expr_result = target->EvaluateExpression (expr_str.c_str(),
|
||||
exe_ctx.GetFramePtr(),
|
||||
expr_result_valobj_sp,
|
||||
options);
|
||||
exe_ctx.GetFramePtr(),
|
||||
expr_result_valobj_sp,
|
||||
options);
|
||||
|
||||
if (expr_result == eExpressionCompleted)
|
||||
{
|
||||
Scalar scalar;
|
||||
if (expr_result_valobj_sp)
|
||||
expr_result_valobj_sp = expr_result_valobj_sp->GetQualifiedRepresentationIfAvailable(expr_result_valobj_sp->GetDynamicValueType(), true);
|
||||
if (expr_result_valobj_sp->ResolveValue (scalar))
|
||||
{
|
||||
command.erase (start_backtick, end_backtick - start_backtick + 1);
|
||||
|
|
Loading…
Reference in New Issue