This is an archive of the discontinued LLVM Phabricator instance.

[yaml2obj] - Add testing for OSABI field.
ClosedPublic

Authored by grimar on Dec 20 2019, 6:40 AM.

Details

Summary

We have no such testing. This makes impossible
to add support for new ELFOSABI_* tags.

Diff Detail

Event Timeline

grimar created this revision.Dec 20 2019, 6:40 AM
Herald added a project: Restricted Project. · View Herald Transcript

This is fine, but I wonder what you think about testing using od, to avoid things being circular here? Presumably you will use yaml2obj to test llvm-readobj prints the right value for the field, which means that theoretically, both could be broken in the same way and we wouldn't notice.

So I dug around, and there was once-upon-a-time testing for this, but you deleted it in rL367988... It wasn't as comprehensive as this though.

grimar added a comment.EditedDec 20 2019, 7:06 AM

This is fine, but I wonder what you think about testing using od, to avoid things being circular here? Presumably you will use yaml2obj to test llvm-readobj prints the right value for the field, which means that theoretically, both could be broken in the same way and we wouldn't notice.

Well. But we know the correct enum values from start, don't we? For example we check OS/ABI: CloudABI (0x11), we know that enum value of ELFOSABI_CLOUDABI is 0x11,
and that llvm-readelf dumps the same. So it can't be broken I think.

This revision is now accepted and ready to land.Dec 20 2019, 7:11 AM
grimar added a comment.EditedDec 20 2019, 7:14 AM

This is fine, but I wonder what you think about testing using od, to avoid things being circular here? Presumably you will use yaml2obj to test llvm-readobj prints the right value for the field, which means that theoretically, both could be broken in the same way and we wouldn't notice.

Ok, I see a possbile scenario now. Like yaml2obj writes X instead of Y and then readelf reads X and shows Y. But that way we should use od everywhere and verify od with other tools too, because od might be broken in the same way too :) It is too much probably?

MaskRay resigned from this revision.Dec 22 2019, 12:08 AM
MaskRay accepted this revision.Dec 22 2019, 12:08 AM
This revision was automatically updated to reflect the committed changes.