1 // TEST_CFLAGS -Wno-deprecated-declarations
5 #include <objc/objc-gdb.h>
6 #include <objc/runtime.h>
8 #define SwiftV1MangledName4 "_TtC6Swiftt13SwiftV1Class4"
9 __attribute__((objc_runtime_name(SwiftV1MangledName4)))
10 @interface SwiftV1Class4 : TestRoot @end
11 @implementation SwiftV1Class4 @end
18 // Class should not be realized yet
19 // fixme not true during class hash rearrangement
20 // result = NXMapGet(gdb_objc_realized_classes, "TestRoot");
21 // testassert(!result);
24 // Now class should be realized
26 result = (__bridge Class)(NXMapGet(gdb_objc_realized_classes, "TestRoot"));
28 testassert(result == [TestRoot class]);
30 result = (__bridge Class)(NXMapGet(gdb_objc_realized_classes, "DoesNotExist"));
33 // Class structure decoding
35 uintptr_t *maskp = (uintptr_t *)dlsym(RTLD_DEFAULT, "objc_debug_class_rw_data_mask");
39 testassert(strcmp(objc_debug_class_getNameRaw([SwiftV1Class4 class]), SwiftV1MangledName4) == 0);
40 testassert(strcmp(objc_debug_class_getNameRaw([TestRoot class]), "TestRoot") == 0);