[sanitizer] Update "sancov.py missing" to allow __sanitizer_cov_with_check().
authorSergey Matveev <earthdok@google.com>
Tue, 12 May 2015 16:46:54 +0000 (16:46 +0000)
committerSergey Matveev <earthdok@google.com>
Tue, 12 May 2015 16:46:54 +0000 (16:46 +0000)
llvm-svn: 237149

compiler-rt/lib/sanitizer_common/scripts/sancov.py

index c6cc4ba..a5ae957 100755 (executable)
@@ -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)