]> granicus.if.org Git - llvm/commitdiff
Updated llvm-objdump with Mach-O files and the -objc-meta-data option so
authorKevin Enderby <enderby@apple.com>
Tue, 20 Jun 2017 22:55:11 +0000 (22:55 +0000)
committerKevin Enderby <enderby@apple.com>
Tue, 20 Jun 2017 22:55:11 +0000 (22:55 +0000)
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

test/tools/llvm-objdump/X86/macho-objc-meta-data.test
tools/llvm-objdump/MachODump.cpp

index 0bdb39cdff843112e3b1897d7915c5e79f94b784..0c38a649c5ae6015f606777bbea963cc2df9ece6 100644 (file)
@@ -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 *)
index 99d2dbd3017908f288900e8a77de4536e70dfbb3..960ef6be4146c4dc3f59047790d07f7ed8ed50ba 100644 (file)
@@ -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);