mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Runtime] Expose the protocol conformance state as a _swift_debug variable.
Have Remote Mirror look that up instead of the C++ mangled name. rdar://problem/55481578
This commit is contained in:
@@ -818,12 +818,20 @@ public:
|
||||
|
||||
llvm::Optional<std::string> iterateConformances(
|
||||
std::function<void(StoredPointer Type, StoredPointer Proto)> Call) {
|
||||
std::string ConformancesName = "__ZL12Conformances";
|
||||
auto ConformancesAddr = getReader().getSymbolAddress(ConformancesName);
|
||||
if (!ConformancesAddr)
|
||||
return "unable to look up conformances cache symbol " + ConformancesName;
|
||||
std::string ConformancesPointerName =
|
||||
"__swift_debug_protocolConformanceStatePointer";
|
||||
auto ConformancesAddrAddr =
|
||||
getReader().getSymbolAddress(ConformancesPointerName);
|
||||
if (!ConformancesAddrAddr)
|
||||
return "unable to look up debug variable " + ConformancesPointerName;
|
||||
|
||||
auto Root = getReader().readPointer(ConformancesAddr, sizeof(StoredPointer));
|
||||
auto ConformancesAddr =
|
||||
getReader().readPointer(ConformancesAddrAddr, sizeof(StoredPointer));
|
||||
if (!ConformancesAddr)
|
||||
return "unable to read value of " + ConformancesPointerName;
|
||||
|
||||
auto Root = getReader().readPointer(ConformancesAddr->getResolvedAddress(),
|
||||
sizeof(StoredPointer));
|
||||
iterateConformanceTree(Root->getResolvedAddress().getAddressData(), Call);
|
||||
return llvm::None;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user