This is an archive of the discontinued LLVM Phabricator instance.

Retrieve the deployment target when retrieving an object file's triple
ClosedPublic

Authored by aprantl on May 9 2018, 6:11 PM.

Details

Summary

Getting the deployment target can be significant information when rebuilding clang modules since availability information could depend on it. The unittest is cargo-culted from the ELF unit tests.

rdar://problem/40039633

Diff Detail

Repository
rL LLVM

Event Timeline

aprantl created this revision.May 9 2018, 6:11 PM
labath added a subscriber: labath.May 10 2018, 1:40 AM

The test you copied this from predates lldb-test (and it tests some behavior quirks which are not nicely expressible in text output). We should have nicer ways of testing things like this now. It should be sufficient to add a print line which displays the triple in the dumpModules function in lldb-test.cpp. Then you can just run lldb-test module-sections your-file and FileCheck that.

The other thing you will need to do is make this test darwin-only as right now our MachO parsing code does not work on non-apple platforms. The reason for that is very silly - ObjectFileMachO depends on RegisterContextDarwin_XXX (presumably to read register information from core files), which use constants like KERN_SUCCESS from system headers. (I've looked at this recently because I wanted to make some cross-platform tests for apple debug info and got stuck here.)

aprantl updated this revision to Diff 146234.May 10 2018, 2:51 PM

Much smaller test thanks to Pavel's suggestion!

aprantl updated this revision to Diff 146235.May 10 2018, 2:52 PM

Added a REQUIRES: darwin

jasonmolenda accepted this revision.May 10 2018, 5:41 PM

Looks good.

This revision is now accepted and ready to land.May 10 2018, 5:41 PM
This revision was automatically updated to reflect the committed changes.