This is an archive of the discontinued LLVM Phabricator instance.

Fix sancov.py when objdump is llvm-objdump
ClosedPublic

Authored by arichardson on Oct 18 2020, 10:15 AM.

Details

Reviewers
eugenis
kcc
vitalybuka
Group Reviewers
Restricted Project
Commits
rG89031cffd1de: Fix sancov.py when objdump is llvm-objdump
Summary

The sanitizer-coverage.cpp test case was always failing for me. It turns
out the reason for this is that I was building with
-DLLVM_INSTALL_BINUTILS_SYMLINKS=ON and sancov.py's grep regex does not
handle llvm-objdumps disassembly format. While touching those lines also
change them to use raw string literals since invalid escape sequnces will
become an error in future python versions and simplify the code by using
subprocess.check_output() instead of Popen(). This also works with python2.

Fixes https://bugs.llvm.org/show_bug.cgi?id=44504

Diff Detail

Event Timeline

arichardson created this revision.Oct 18 2020, 10:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 18 2020, 10:15 AM
arichardson requested review of this revision.Oct 18 2020, 10:15 AM

can we have a test for this to see a difference?

can we have a test for this to see a difference?

Well, sanitizer-coverage.cpp fails if objdump == llvm-objdump before. Is that not sufficient? I don't really know anything about sanitizer converage, I'm just trying to fix ninja check-all so I'm not sure what kind of test this would need.

The difference is that GNU objdump by default prints 0xabc call 12345 <__sanitizer_cov... whereas llvm-objdump defaults to hex immediates: 0xabc call 0x1234 <__sanitizer_cov...

vitalybuka accepted this revision.Oct 20 2020, 3:42 AM
This revision is now accepted and ready to land.Oct 20 2020, 3:42 AM
This revision was automatically updated to reflect the committed changes.