Author: enrico
Date: Fri Nov 13 15:55:41 2015
New Revision: 253093
URL: http://llvm.org/viewvc/llvm-project?rev=253093&view=rev
Log:
Upstream some data formatter related cleanups
Modified:
lldb/trunk/source/DataFormatters/FormattersHelpers.cpp
Modified: lldb/trunk/source/DataFormatters/FormattersHelpers.cpp
URL:
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormattersHelpers.cpp?rev=253093&r1=253092&r2=253093&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/FormattersHelpers.cpp (original)
+++ lldb/trunk/source/DataFormatters/FormattersHelpers.cpp Fri Nov 13 15:55:41
2015
@@ -173,7 +173,10 @@ lldb_private::formatters::ExtractValueFr
options.SetCoerceToId(false);
options.SetUnwindOnError(true);
options.SetKeepInMemory(true);
-
+ options.SetLanguage(lldb::eLanguageTypeObjC_plus_plus);
+ options.SetResultIsInternal(true);
+ options.SetUseDynamic(lldb::eDynamicCanRunTarget);
+
target->EvaluateExpression(expr.GetData(),
stack_frame,
result_sp,
@@ -233,10 +236,12 @@ lldb_private::formatters::CallSelectorOn
return valobj_sp;
if (!selector || !*selector)
return valobj_sp;
- StreamString expr_path_stream;
- valobj.GetExpressionPath(expr_path_stream, false);
StreamString expr;
- expr.Printf("(%s)[%s %s:%" PRId64
"]",return_type,expr_path_stream.GetData(),selector,index);
+ const char *colon = "";
+ llvm::StringRef selector_sr(selector);
+ if (selector_sr.back() != ':')
+ colon = ":";
+ expr.Printf("(%s)[(id)0x%" PRIx64 " %s%s%" PRId64
"]",return_type,valobj.GetPointerValue(),selector,colon,index);
ExecutionContext exe_ctx (valobj.GetExecutionContextRef());
lldb::ValueObjectSP result_sp;
Target* target = exe_ctx.GetTargetPtr();
@@ -248,6 +253,8 @@ lldb_private::formatters::CallSelectorOn
options.SetCoerceToId(false);
options.SetUnwindOnError(true);
options.SetKeepInMemory(true);
+ options.SetLanguage(lldb::eLanguageTypeObjC_plus_plus);
+ options.SetResultIsInternal(true);
options.SetUseDynamic(lldb::eDynamicCanRunTarget);
target->EvaluateExpression(expr.GetData(),
@@ -270,10 +277,12 @@ lldb_private::formatters::CallSelectorOn
return valobj_sp;
if (!key || !*key)
return valobj_sp;
- StreamString expr_path_stream;
- valobj.GetExpressionPath(expr_path_stream, false);
StreamString expr;
- expr.Printf("(%s)[%s
%s:%s]",return_type,expr_path_stream.GetData(),selector,key);
+ const char *colon = "";
+ llvm::StringRef selector_sr(selector);
+ if (selector_sr.back() != ':')
+ colon = ":";
+ expr.Printf("(%s)[(id)0x%" PRIx64 "
%s%s%s]",return_type,valobj.GetPointerValue(),selector,colon,key);
ExecutionContext exe_ctx (valobj.GetExecutionContextRef());
lldb::ValueObjectSP result_sp;
Target* target = exe_ctx.GetTargetPtr();
@@ -285,6 +294,8 @@ lldb_private::formatters::CallSelectorOn
options.SetCoerceToId(false);
options.SetUnwindOnError(true);
options.SetKeepInMemory(true);
+ options.SetLanguage(lldb::eLanguageTypeObjC_plus_plus);
+ options.SetResultIsInternal(true);
options.SetUseDynamic(lldb::eDynamicCanRunTarget);
target->EvaluateExpression(expr.GetData(),
_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits