From: Kevin Enderby Date: Tue, 20 Jun 2017 22:55:11 +0000 (+0000) Subject: Updated llvm-objdump with Mach-O files and the -objc-meta-data option so X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f8a3ad7e76c62f1e0d1d6f505d43182f4d398659;p=llvm Updated llvm-objdump with Mach-O files and the -objc-meta-data option so that it symbolically prints the superclass when it has dyld bind info for it. rdar://7638823 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305866 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/tools/llvm-objdump/X86/macho-objc-meta-data.test b/test/tools/llvm-objdump/X86/macho-objc-meta-data.test index 0bdb39cdff8..0c38a649c5a 100644 --- a/test/tools/llvm-objdump/X86/macho-objc-meta-data.test +++ b/test/tools/llvm-objdump/X86/macho-objc-meta-data.test @@ -1042,7 +1042,7 @@ PROTOCOL: class_methods 0x00000000 (not in an __OBJC section) OBJC2_64BIT_DYLIB: Contents of (__DATA_CONST,__objc_classlist) section OBJC2_64BIT_DYLIB: 000000000000c038 0x8030 _OBJC_CLASS_$_Test OBJC2_64BIT_DYLIB: isa 0x8008 _OBJC_METACLASS_$_Test -OBJC2_64BIT_DYLIB: superclass 0x0 +OBJC2_64BIT_DYLIB: superclass 0x0 _OBJC_CLASS_$_NSObject OBJC2_64BIT_DYLIB: cache 0x0 OBJC2_64BIT_DYLIB: vtable 0x0 OBJC2_64BIT_DYLIB: data 0xc120 (struct class_ro_t *) @@ -1081,7 +1081,7 @@ OBJC2_64BIT_DYLIB: name 0x4f42 testProp OBJC2_64BIT_DYLIB: attributes 0x4f4b TQ,V_testProp OBJC2_64BIT_DYLIB: Meta Class OBJC2_64BIT_DYLIB: isa 0x0 -OBJC2_64BIT_DYLIB: superclass 0x0 +OBJC2_64BIT_DYLIB: superclass 0x0 _OBJC_METACLASS_$_NSObject OBJC2_64BIT_DYLIB: cache 0x0 OBJC2_64BIT_DYLIB: vtable 0x0 OBJC2_64BIT_DYLIB: data 0xc048 (struct class_ro_t *) diff --git a/tools/llvm-objdump/MachODump.cpp b/tools/llvm-objdump/MachODump.cpp index 99d2dbd3017..960ef6be414 100644 --- a/tools/llvm-objdump/MachODump.cpp +++ b/tools/llvm-objdump/MachODump.cpp @@ -4573,6 +4573,12 @@ static void print_class64_t(uint64_t p, struct DisassembleInfo *info) { n_value, c.superclass); if (name != nullptr) outs() << " " << name; + else { + name = get_dyld_bind_info_symbolname(S.getAddress() + + offset + offsetof(struct class64_t, superclass), info); + if (name != nullptr) + outs() << " " << name; + } outs() << "\n"; outs() << " cache " << format("0x%" PRIx64, c.cache);