summaryrefslogtreecommitdiffstats
path: root/lldb/source/API/SBTarget.cpp
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2012-12-19 23:05:01 +0000
committerSean Callanan <scallanan@apple.com>2012-12-19 23:05:01 +0000
commit7be70e85287e5b6f8acd38faff28895ddf58ca4f (patch)
tree947ffc9b59a760d3cad654d7d63cebbe874ad701 /lldb/source/API/SBTarget.cpp
parent6848e38daf24547a639a48e4585fef5268ede3cc (diff)
downloadbcm5719-llvm-7be70e85287e5b6f8acd38faff28895ddf58ca4f.tar.gz
bcm5719-llvm-7be70e85287e5b6f8acd38faff28895ddf58ca4f.zip
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> llvm-svn: 170601
Diffstat (limited to 'lldb/source/API/SBTarget.cpp')
-rw-r--r--lldb/source/API/SBTarget.cpp53
1 files changed, 52 insertions, 1 deletions
diff --git a/lldb/source/API/SBTarget.cpp b/lldb/source/API/SBTarget.cpp
index 0ce361cb54d..c6c4f72d5b6 100644
--- a/lldb/source/API/SBTarget.cpp
+++ b/lldb/source/API/SBTarget.cpp
@@ -2085,6 +2085,29 @@ SBTarget::FindFirstType (const char* typename_cstr)
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 @@ SBTarget::FindTypes (const char* typename_cstr)
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();
OpenPOWER on IntegriCloud