<rdar://problem/12711206>
Extending ValueObjectDynamicValue so that it stores a TypeAndOrName instead of a TypeSP.
This change allows us to reflect the notion that a ValueObject can have a dynamic type for which we have no debug information.
Previously, we would coalesce that to the static type of the object, potentially losing relevant information or even getting it wrong.
This fix ensures we can correctly report the class name for Cocoa objects whose types are hidden classes that we know nothing about (e.g. __NSArrayI for immutable arrays).
As a side effect, our --show-types argument to frame variable no longer needs to append custom dynamic type information.
llvm-svn: 173216
diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp
index 449e49c..92d2c36 100644
--- a/lldb/source/Core/ValueObject.cpp
+++ b/lldb/source/Core/ValueObject.cpp
@@ -3336,38 +3336,7 @@
show_type = options.m_show_types || (curr_depth == 0 && !options.m_flat_output);
if (show_type)
- {
- const char* typeName = valobj->GetQualifiedTypeName().AsCString("<invalid type>");
- //const char* typeName = valobj->GetTypeName().AsCString("<invalid type>");
- s.Printf("(%s", typeName);
- // only show dynamic types if the user really wants to see types
- if (options.m_show_types && options.m_use_dynamic != eNoDynamicValues &&
- (/*strstr(typeName, "id") == typeName ||*/
- ClangASTType::GetMinimumLanguage(valobj->GetClangAST(), valobj->GetClangType()) == eLanguageTypeObjC))
- {
- ExecutionContext exe_ctx (valobj->GetExecutionContextRef());
- Process *process = exe_ctx.GetProcessPtr();
- if (process == NULL)
- s.Printf(", dynamic type: unknown) ");
- else
- {
- ObjCLanguageRuntime *runtime = process->GetObjCLanguageRuntime();
- if (runtime == NULL)
- s.Printf(", dynamic type: unknown) ");
- else
- {
- ObjCLanguageRuntime::ClassDescriptorSP objc_class_sp (runtime->GetNonKVOClassDescriptor(*valobj));
- if (objc_class_sp)
- s.Printf(", dynamic type: %s) ", objc_class_sp->GetClassName().GetCString());
- else
- s.Printf(", dynamic type: unknown) ");
- }
- }
- }
- else
- s.Printf(") ");
- }
-
+ s.Printf("(%s) ", valobj->GetQualifiedTypeName().AsCString("<invalid type>"));
if (options.m_flat_output)
{