This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Instantiate lazily named classes on macOS Ventura.
ClosedPublic

Authored by JDevlieghere on Jun 21 2022, 2:20 PM.

Details

Summary

Recent revisions of the Objective-C runtime changed
objc_debug_class_getNameRaw() in a way that no longer triggers lazy
names to be instantiated. This has the unintended side-effect of making
generic bridged Swift classes, such as _SwiftDeferredNSDictionary<U,V>
to become invisible to the Objective-C runtime.

This patch detects this situation and forces the names to be
instantiated by calling class_getName() and discarding the result before
calling objc_debug_class_getNameRaw() again.

Many thanks to Mike Ash for outlining the solution and Adrian for
authoring the downstream patch.

rdar://95245318

Diff Detail

Event Timeline

JDevlieghere created this revision.Jun 21 2022, 2:20 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 21 2022, 2:20 PM
JDevlieghere requested review of this revision.Jun 21 2022, 2:20 PM
aprantl accepted this revision.Jun 21 2022, 4:36 PM

Thanks!

This revision is now accepted and ready to land.Jun 21 2022, 4:36 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 21 2022, 6:51 PM