This is an archive of the discontinued LLVM Phabricator instance.

llvm-objdump -macho -objc-meta-data should print body of protocols in protolist
AbandonedPublic

Authored by mtrent on Feb 11 2019, 8:51 AM.

Details

Summary

llvm-objdump -macho -objc-meta-data should print body of protocols in protolist

llvm-objdump will display Objective-C and Swift metadata in a Mach-O file.
Previously, llvm-objdump would display the address of struct protocol_t data
but would not display its contents, and struct protocol_list_t data would only
be displayed as it was used by other classes and categories in the file. Now
llvm-objdump will display the contents of the struct protocol_t data, showing
protocols known to the binary at build time regardless of if they are used by
classes in that file.

The existing macho-objc-meta-data lit test case has been extended to validate
Objective-C metadata when present in a file.

rdar://47950100

Diff Detail

Event Timeline

mtrent created this revision.Feb 11 2019, 8:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 11 2019, 8:51 AM
Herald added a subscriber: rupprecht. · View Herald Transcript
pete accepted this revision.Feb 11 2019, 10:02 AM

LGTM.

Looks like we can have print_protocol_list64_t also call the new print_protocol_64_t, but that can be done in a later NFC commit.

This revision is now accepted and ready to land.Feb 11 2019, 10:02 AM
mtrent updated this revision to Diff 186333.Feb 11 2019, 2:14 PM

Always print the imp pointer.

mtrent updated this revision to Diff 186334.Feb 11 2019, 2:17 PM

... and fix the lit test when always printing the imp pointer.

LGTM.

Looks like we can have print_protocol_list64_t also call the new print_protocol_64_t, but that can be done in a later NFC commit.

Thanks Pete! I took a swipe at it and realized fixing the formatting is a bit more work than we want to bite off right now. But I realized also that objdump isn't printing the imp pointer any more (I think this regressed in March?) so I put it back. The lit test ought to shore up objdump against further regressions.

mtrent abandoned this revision.Feb 11 2019, 8:44 PM

Crud! The wrong code got into this arc request. I'm going to abandon the revision and try again.