Upstream some data formatter related cleanups

llvm-svn: 253093
This commit is contained in:
Enrico Granata 2015-11-13 21:55:41 +00:00
parent 8f186f8574
commit 89d8ef7ee3
1 changed files with 18 additions and 7 deletions

View File

@ -173,6 +173,9 @@ lldb_private::formatters::ExtractValueFromObjCExpression (ValueObject &valobj,
options.SetCoerceToId(false); options.SetCoerceToId(false);
options.SetUnwindOnError(true); options.SetUnwindOnError(true);
options.SetKeepInMemory(true); options.SetKeepInMemory(true);
options.SetLanguage(lldb::eLanguageTypeObjC_plus_plus);
options.SetResultIsInternal(true);
options.SetUseDynamic(lldb::eDynamicCanRunTarget);
target->EvaluateExpression(expr.GetData(), target->EvaluateExpression(expr.GetData(),
stack_frame, stack_frame,
@ -233,10 +236,12 @@ lldb_private::formatters::CallSelectorOnObject (ValueObject &valobj,
return valobj_sp; return valobj_sp;
if (!selector || !*selector) if (!selector || !*selector)
return valobj_sp; return valobj_sp;
StreamString expr_path_stream;
valobj.GetExpressionPath(expr_path_stream, false);
StreamString expr; 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()); ExecutionContext exe_ctx (valobj.GetExecutionContextRef());
lldb::ValueObjectSP result_sp; lldb::ValueObjectSP result_sp;
Target* target = exe_ctx.GetTargetPtr(); Target* target = exe_ctx.GetTargetPtr();
@ -248,6 +253,8 @@ lldb_private::formatters::CallSelectorOnObject (ValueObject &valobj,
options.SetCoerceToId(false); options.SetCoerceToId(false);
options.SetUnwindOnError(true); options.SetUnwindOnError(true);
options.SetKeepInMemory(true); options.SetKeepInMemory(true);
options.SetLanguage(lldb::eLanguageTypeObjC_plus_plus);
options.SetResultIsInternal(true);
options.SetUseDynamic(lldb::eDynamicCanRunTarget); options.SetUseDynamic(lldb::eDynamicCanRunTarget);
target->EvaluateExpression(expr.GetData(), target->EvaluateExpression(expr.GetData(),
@ -270,10 +277,12 @@ lldb_private::formatters::CallSelectorOnObject (ValueObject &valobj,
return valobj_sp; return valobj_sp;
if (!key || !*key) if (!key || !*key)
return valobj_sp; return valobj_sp;
StreamString expr_path_stream;
valobj.GetExpressionPath(expr_path_stream, false);
StreamString expr; 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()); ExecutionContext exe_ctx (valobj.GetExecutionContextRef());
lldb::ValueObjectSP result_sp; lldb::ValueObjectSP result_sp;
Target* target = exe_ctx.GetTargetPtr(); Target* target = exe_ctx.GetTargetPtr();
@ -285,6 +294,8 @@ lldb_private::formatters::CallSelectorOnObject (ValueObject &valobj,
options.SetCoerceToId(false); options.SetCoerceToId(false);
options.SetUnwindOnError(true); options.SetUnwindOnError(true);
options.SetKeepInMemory(true); options.SetKeepInMemory(true);
options.SetLanguage(lldb::eLanguageTypeObjC_plus_plus);
options.SetResultIsInternal(true);
options.SetUseDynamic(lldb::eDynamicCanRunTarget); options.SetUseDynamic(lldb::eDynamicCanRunTarget);
target->EvaluateExpression(expr.GetData(), target->EvaluateExpression(expr.GetData(),