In the data formatters, if we know the result
authorSean Callanan <scallanan@apple.com>
Tue, 4 Dec 2012 20:56:04 +0000 (20:56 +0000)
committerSean Callanan <scallanan@apple.com>
Tue, 4 Dec 2012 20:56:04 +0000 (20:56 +0000)
type of an Objective-C selector, don't bother
making the expression parser resolve it all over
again.  Just send the message straight to the
object pointer as if it were an id, and cast the
result.

<rdar://problem/12799087>

llvm-svn: 169300

lldb/source/Core/CXXFormatterFunctions.cpp

index c458cf2..32bb296 100644 (file)
@@ -37,10 +37,8 @@ lldb_private::formatters::ExtractValueFromObjCExpression (ValueObject &valobj,
         return false;
     if (!selector || !*selector)
         return false;
-    StreamString expr_path_stream;
-    valobj.GetExpressionPath(expr_path_stream, false);
     StreamString expr;
-    expr.Printf("(%s)[%s %s]",target_type,expr_path_stream.GetData(),selector);
+    expr.Printf("(%s)[(id)0x%llx %s]",target_type,valobj.GetPointerValue(),selector);
     ExecutionContext exe_ctx (valobj.GetExecutionContextRef());
     lldb::ValueObjectSP result_sp;
     Target* target = exe_ctx.GetTargetPtr();
@@ -51,8 +49,7 @@ lldb_private::formatters::ExtractValueFromObjCExpression (ValueObject &valobj,
     EvaluateExpressionOptions options;
     options.SetCoerceToId(false)
     .SetUnwindOnError(true)
-    .SetKeepInMemory(true)
-    .SetUseDynamic(lldb::eDynamicCanRunTarget);
+    .SetKeepInMemory(true);
     
     target->EvaluateExpression(expr.GetData(),
                                stack_frame,