This patch removes the SymbolFileSymtab support
for reporting class types from Objective-C runtime
class symbols. Instead, LLDB now queries the
Objective-C runtime for class types.
We have also added a (minimal) Objective-C runtime
type vendor for Objective-C runtime version 1, to
prevent regressions when calling class methods in
the V1 runtime.
Other components of this fix include:
- We search the Objective-C runtime in a few more
places.
- We enable enumeration of all members of
Objective-C classes, which Clang does in certain
circumstances.
- SBTarget::FindFirstType and SBTarget::FindTypes
now query the Objective-C runtime as needed.
- I fixed several test cases.
<rdar://problem/12885034>
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@170601 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBTarget.cpp b/source/API/SBTarget.cpp
index 0ce361c..c6c4f72 100644
--- a/source/API/SBTarget.cpp
+++ b/source/API/SBTarget.cpp
@@ -2085,6 +2085,29 @@
return SBType(type_sp);
}
}
+
+ // Didn't find the type in the symbols; try the Objective-C runtime
+ // if one is installed
+
+ ProcessSP process_sp(target_sp->GetProcessSP());
+
+ if (process_sp)
+ {
+ ObjCLanguageRuntime *objc_language_runtime = process_sp->GetObjCLanguageRuntime();
+
+ if (objc_language_runtime)
+ {
+ TypeVendor *objc_type_vendor = objc_language_runtime->GetTypeVendor();
+
+ if (objc_type_vendor)
+ {
+ std::vector <ClangASTType> types;
+
+ if (objc_type_vendor->FindTypes(const_typename, true, 1, types) > 0)
+ return SBType(types[0]);
+ }
+ }
+ }
// No matches, search for basic typename matches
ClangASTContext *clang_ast = target_sp->GetScratchClangASTContext();
@@ -2136,7 +2159,35 @@
sb_type_list.Append(SBType(type_sp));
}
}
- else
+
+ // Try the Objective-C runtime if one is installed
+
+ ProcessSP process_sp(target_sp->GetProcessSP());
+
+ if (process_sp)
+ {
+ ObjCLanguageRuntime *objc_language_runtime = process_sp->GetObjCLanguageRuntime();
+
+ if (objc_language_runtime)
+ {
+ TypeVendor *objc_type_vendor = objc_language_runtime->GetTypeVendor();
+
+ if (objc_type_vendor)
+ {
+ std::vector <ClangASTType> types;
+
+ if (objc_type_vendor->FindTypes(const_typename, true, UINT32_MAX, types))
+ {
+ for (ClangASTType &type : types)
+ {
+ sb_type_list.Append(SBType(type));
+ }
+ }
+ }
+ }
+ }
+
+ if (sb_type_list.GetSize() == 0)
{
// No matches, search for basic typename matches
ClangASTContext *clang_ast = target_sp->GetScratchClangASTContext();