File tree Expand file tree Collapse file tree 3 files changed +18
-4
lines changed Expand file tree Collapse file tree 3 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -818,12 +818,20 @@ class ReflectionContext
818
818
819
819
llvm::Optional<std::string> iterateConformances (
820
820
std::function<void (StoredPointer Type, StoredPointer Proto)> Call) {
821
- std::string ConformancesName = " __ZL12Conformances" ;
822
- auto ConformancesAddr = getReader ().getSymbolAddress (ConformancesName);
821
+ std::string ConformancesPointerName =
822
+ " __swift_debug_protocolConformanceStatePointer" ;
823
+ auto ConformancesAddrAddr =
824
+ getReader ().getSymbolAddress (ConformancesPointerName);
825
+ if (!ConformancesAddrAddr)
826
+ return " unable to look up debug variable " + ConformancesPointerName;
827
+
828
+ auto ConformancesAddr =
829
+ getReader ().readPointer (ConformancesAddrAddr, sizeof (StoredPointer));
823
830
if (!ConformancesAddr)
824
- return " unable to look up conformances cache symbol " + ConformancesName ;
831
+ return " unable to read value of " + ConformancesPointerName ;
825
832
826
- auto Root = getReader ().readPointer (ConformancesAddr, sizeof (StoredPointer));
833
+ auto Root = getReader ().readPointer (ConformancesAddr->getResolvedAddress (),
834
+ sizeof (StoredPointer));
827
835
iterateConformanceTree (Root->getResolvedAddress ().getAddressData (), Call);
828
836
return llvm::None;
829
837
}
Original file line number Diff line number Diff line change @@ -237,6 +237,9 @@ bool _swift_debug_metadataAllocationIterationEnabled;
237
237
SWIFT_RUNTIME_STDLIB_SPI
238
238
const void * const _swift_debug_allocationPoolPointer;
239
239
240
+ SWIFT_RUNTIME_STDLIB_SPI
241
+ const void * const _swift_debug_protocolConformanceStatePointer;
242
+
240
243
SWIFT_RUNTIME_ATTRIBUTE_ALWAYS_INLINE
241
244
inline static int swift_asprintf (char **strp, const char *fmt, ...) {
242
245
va_list args;
Original file line number Diff line number Diff line change @@ -315,6 +315,9 @@ void ConformanceState::verify() const {
315
315
316
316
static Lazy<ConformanceState> Conformances;
317
317
318
+ const void * const swift::_swift_debug_protocolConformanceStatePointer =
319
+ &Conformances;
320
+
318
321
static void
319
322
_registerProtocolConformances (ConformanceState &C,
320
323
const ProtocolConformanceRecord *begin,
You can’t perform that action at this time.
0 commit comments