[PATCH] D85208: [llvm-readobj/elf] - Add a testing for --stackmap and refine the implementation.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 4 06:22:26 PDT 2020


grimar created this revision.
grimar added reviewers: jhenderson, MaskRay.
Herald added subscribers: rupprecht, hiraditya, emaste.
Herald added a reviewer: espindola.
Herald added a project: LLVM.
grimar requested review of this revision.

Currently, we only test the `--stackmap` option here:
https://github.com/llvm/llvm-project/blob/master/llvm/test/Object/stackmap-dump.test
it uses a precompiled MachO binary currently and I've found no tests for this option for ELF.

The implementation also has issues. For example, it might assert on a wrong version
of the .llvm-stackmaps section. Or it might crash on an empty or truncated section.

This patch introduces a new tools/llvm-readobj/ELF test file as well as implements a few
basic checks to catch simple crashes/issues

It also eliminates `unwrapOrError` calls in `printStackMap()`.


https://reviews.llvm.org/D85208

Files:
  llvm/include/llvm/Object/StackMapParser.h
  llvm/lib/CodeGen/StackMaps.cpp
  llvm/test/tools/llvm-readobj/ELF/stackmap.test
  llvm/tools/llvm-readobj/COFFDumper.cpp
  llvm/tools/llvm-readobj/ELFDumper.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D85208.282893.patch
Type: text/x-patch
Size: 8116 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200804/eb5ad20e/attachment.bin>


More information about the llvm-commits mailing list