From: Maria Guseva Date: Fri, 9 Jun 2017 09:47:36 +0000 (+0300) Subject: Fix regexp expressions in sancov.py to work with old grep on Tizen X-Git-Tag: submit/tizen/20170714.013956~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=33bd5db2edaf7d5d59a00ed1137eda6ae8ed2d3e;p=tools%2FlibFuzzer.git Fix regexp expressions in sancov.py to work with old grep on Tizen Grep is known to treat "\s" differently: only in newer versions it is intrepreted as whitespace. See http://savannah.gnu.org/bugs/?30515 for details On Tizen the grep verions is 2.5.2 and "\s" is not yet supported as a special symbol there. --- diff --git a/scripts/sancov.py b/scripts/sancov.py index d1180fb..5c12aa6 100755 --- a/scripts/sancov.py +++ b/scripts/sancov.py @@ -194,8 +194,8 @@ def GetInstrumentedPCs(binary): # - 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\(_with_check\|\)\(_trace_pc\|\)\(@plt\|\)>' | " \ - "grep '^\s\+[0-9a-f]\+' -o" % binary + "grep '^[[:space:]]\+[0-9a-f]\+:.*[[:space:]]call\(q\|\)[[:space:]]\+[0-9a-f]\+ <__sanitizer_cov\(_with_check\|\)\(_trace_pc\|\)\(@plt\|\)>' | " \ + "grep '^[[:space:]]\+[0-9a-f]\+' -o" % binary proc = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, shell=True) proc.stdin.close()