[Lldb-commits] [lldb] r219452 - 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

Enrico Granata egranata at apple.com
Thu Oct 9 16:09:41 PDT 2014


Author: enrico
Date: Thu Oct  9 18:09:40 2014
New Revision: 219452

URL: http://llvm.org/viewvc/llvm-project?rev=219452&view=rev
Log:
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

Modified:
    lldb/trunk/source/Interpreter/Args.cpp
    lldb/trunk/source/Interpreter/CommandInterpreter.cpp

Modified: lldb/trunk/source/Interpreter/Args.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/Args.cpp?rev=219452&r1=219451&r2=219452&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/Args.cpp (original)
+++ lldb/trunk/source/Interpreter/Args.cpp Thu Oct  9 18:09:40 2014
@@ -871,15 +871,18 @@ Args::StringToAddress (const ExecutionCo
                 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)

Modified: lldb/trunk/source/Interpreter/CommandInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandInterpreter.cpp?rev=219452&r1=219451&r2=219452&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/CommandInterpreter.cpp (original)
+++ lldb/trunk/source/Interpreter/CommandInterpreter.cpp Thu Oct  9 18:09:40 2014
@@ -1466,13 +1466,15 @@ CommandInterpreter::PreprocessCommand (s
                     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);





More information about the lldb-commits mailing list