Introduce a variant of GetSummaryAsCString() that takes a LanguageType argument, and use it when crafting summaries by running selectors
This is the first in a series of commits that are meant to teach LLDB how to properly handle multi-language formatting of values
llvm-svn: 249503
diff --git a/lldb/source/DataFormatters/FormattersHelpers.cpp b/lldb/source/DataFormatters/FormattersHelpers.cpp
index 648913e..290fda0 100644
--- a/lldb/source/DataFormatters/FormattersHelpers.cpp
+++ b/lldb/source/DataFormatters/FormattersHelpers.cpp
@@ -187,7 +187,8 @@
lldb_private::formatters::ExtractSummaryFromObjCExpression (ValueObject &valobj,
const char* target_type,
const char* selector,
- Stream &stream)
+ Stream &stream,
+ lldb::LanguageType lang_type)
{
if (!target_type || !*target_type)
return false;
@@ -206,6 +207,8 @@
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(),
@@ -214,7 +217,7 @@
options);
if (!result_sp)
return false;
- stream.Printf("%s",result_sp->GetSummaryAsCString());
+ stream.Printf("%s",result_sp->GetSummaryAsCString(lang_type));
return true;
}