This is an archive of the discontinued LLVM Phabricator instance.

Print the eh_frame section in MachoDump
AbandonedPublic

Authored by pete on Dec 14 2015, 9:49 AM.

Details

Reviewers
enderby
lhames
Summary

Hi Kevin

This is the start of work to emit the __eh_frame section in llvm-objdump.

I've currently got code to emit the CIE's. I'll add more code later for decoding the instructions, FDE's, and error checking (at the very least making sure things are in bounds and pointing to the correct place where possible). This patch seemed big enough that i'd like to make sure its ok before continuing to add anything else.

Thanks
Pete

Diff Detail

Event Timeline

pete updated this revision to Diff 42732.Dec 14 2015, 9:49 AM
pete retitled this revision from to Print the eh_frame section in MachoDump.
pete updated this object.
pete added a reviewer: enderby.
pete set the repository for this revision to rL LLVM.
pete added subscribers: lhames, rafael.
enderby edited edge metadata.Dec 14 2015, 10:12 AM
enderby added a subscriber: enderby.

Hi Pete,

I don’t know the details of the EH frame info encoding so likely Lang or Rafael will have to take a look at that. But what you have looks fine to me.

One thing though, I’m not a fan of asserts in code trying to print data from object files when some of the data is malformed. Generally these come back to us as bugs against the tool printing the info when it crashes. I would prefer just printing a error message with enough detail to describe what is malformed in the encoding and the name of the object file. That would be enough for me. However I suspect Rafael may want to insist that the tool exit non-zero in this case as well. And maybe even plumb a error return code through the code.

My thoughts,
Kev

pete edited edge metadata.Dec 14 2015, 1:01 PM
pete added a subscriber: llvm-commits.
lhames accepted this revision.Dec 14 2015, 1:14 PM
lhames added a reviewer: lhames.

I'd second Kevin's comments on the error-handling. I think it's ok to go in with the asserts while you figure out what the right error handling scheme is though.

The rest of this looks good to me.

This revision is now accepted and ready to land.Dec 14 2015, 1:14 PM
pete abandoned this revision.Feb 1 2016, 4:50 PM

Some updates to this which are already out of date.

The patch landed, but was reverted as it turns out we already had an eh_frame parser in llvm-dwarfdump. Another commit followed which hooked that up to objdump instead of using this code.