summaryrefslogtreecommitdiffstats
path: root/third_party/heimdal/tools/fixgcov-source-paths.sh
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/heimdal/tools/fixgcov-source-paths.sh')
-rwxr-xr-xthird_party/heimdal/tools/fixgcov-source-paths.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/third_party/heimdal/tools/fixgcov-source-paths.sh b/third_party/heimdal/tools/fixgcov-source-paths.sh
new file mode 100755
index 0000000..eaa9c9c
--- /dev/null
+++ b/third_party/heimdal/tools/fixgcov-source-paths.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+find ${1:-.} -name '*.gcov' -print | while read f; do
+ case "$f" in
+ */.libs/*) continue;;
+ *) true;;
+ esac
+ echo FIX $f
+ f_basename=${f%%.gcno\#\#*}.c
+ f_basename=${f_basename##*/}
+ head -1 "$f" | grep 'Source:/' > /dev/null && continue
+ #bname=$(head -1 "$f" | grep 'Source:/' | cut -d: -f4)
+ dname=$(echo "$f"|cut -d'#' -f1|sed -e 's,/[^/]*$,/,')
+ ex "$f" <<EOF
+1,1 s,:Source:.*$,:Source:${dname}${f_basename},
+wq!
+EOF
+done