This is an archive of the discontinued LLVM Phabricator instance.

[llvm-objdump-macho] print per-second-level-page encodings for option --unwind-info
ClosedPublic

Authored by gkm on Dec 14 2020, 6:45 PM.

Details

Summary

Compact unwind entries have 8 bits for the encoding-table offset:

  • offsets 0..126 reference the global commmon-encodings table, while
  • offsets 127..255 reference a per-second-level-page table.

This diff teaches llvm-objdump to print this per-page encodings table.

Diff Detail

Event Timeline

gkm created this revision.Dec 14 2020, 6:45 PM
gkm requested review of this revision.Dec 14 2020, 6:45 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 14 2020, 6:45 PM
int3 added a subscriber: int3.Dec 17 2020, 2:20 PM

Should we have a test?

gkm updated this revision to Diff 313031.Dec 21 2020, 12:12 AM
  • add test case
MaskRay added inline comments.Dec 21 2020, 9:44 AM
llvm/test/tools/llvm-objdump/MachO/unwind-info-excess-x86_64.test
2

A prebuilt binary is difficult to inspect and update. Can you rewrite the input with yaml2obj?

There are plenty of examples in the ELF/ folder (and in various test/tools/*/ELF directories)

The test should also include a file level comment documenting its purpose.

gkm added inline comments.Dec 21 2020, 11:57 AM
llvm/test/tools/llvm-objdump/MachO/unwind-info-excess-x86_64.test
2

Very good. FYI, I was following prior practice, where there are already 71 binaries and not even one *.yaml in llvm/test/tools/llvm-objdump/MachO/Inputs/.

Yaml isn't so great either: it's text, but nearly as opaque as a binary. I favor using llvm-mc on assembler inputs. My compact-unwind test in lld/test/MachO goes further: Because the assembler input is 1 MiB, I have a python script (which also serves as a fuzzer) to generate it. The downside is significant CPU time for llvm-mc to process the test. It's not so bad on a release tree (approx 1s), but slow on a debug tree (approx 10s). I could solve that by preferring the installed llvm-mc, but all the existing tests just do RUN: llvm-mc ... and get the build tree's version, so I'm not sure how to do that.

Please advise.

gkm updated this revision to Diff 317436.Jan 18 2021, 4:17 PM
  • Pare CHECK lines to the essentials. Add comments to the test: purpose, plus rationale for binary input.
int3 accepted this revision.Jan 19 2021, 11:36 AM

seems legit

This revision is now accepted and ready to land.Jan 19 2021, 11:36 AM
This revision was landed with ongoing or failed builds.Jan 29 2021, 9:28 PM
This revision was automatically updated to reflect the committed changes.