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:
Enrico Granata 2014-10-09 23:09:40 +00:00
parent 32cac2e062
commit ca0e5ad3d3
2 changed files with 12 additions and 7 deletions

View File

@ -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)

View File

@ -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);