From f57fb6ce1ae1a9f85ba70d8e251559ac2aa8bc75 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Tue, 12 May 2015 16:46:54 +0000 Subject: [PATCH] [sanitizer] Update "sancov.py missing" to allow __sanitizer_cov_with_check(). llvm-svn: 237149 --- compiler-rt/lib/sanitizer_common/scripts/sancov.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler-rt/lib/sanitizer_common/scripts/sancov.py b/compiler-rt/lib/sanitizer_common/scripts/sancov.py index c6cc4ba..a5ae957 100755 --- a/compiler-rt/lib/sanitizer_common/scripts/sancov.py +++ b/compiler-rt/lib/sanitizer_common/scripts/sancov.py @@ -180,8 +180,12 @@ def RawUnpack(files): UnpackOneRawFile(f, f_map) def GetInstrumentedPCs(binary): + # This looks scary, but all it does is extract all offsets where we call: + # - __sanitizer_cov() or __sanitizer_cov_with_check(), + # - with call or callq, + # - directly or via PLT. cmd = "objdump -d %s | " \ - "grep '^\s\+[0-9a-f]\+:.*\scall\(q\|\)\s\+[0-9a-f]\+ <__sanitizer_cov\(@plt\|\)>' | " \ + "grep '^\s\+[0-9a-f]\+:.*\scall\(q\|\)\s\+[0-9a-f]\+ <__sanitizer_cov\(_with_check\|\)\(@plt\|\)>' | " \ "grep '^\s\+[0-9a-f]\+' -o" % binary proc = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, shell=True) -- 2.7.4