pastebin - collaborative debugging tool
nrubsig.kpaste.net RSS


drcovlog_genhtml.ksh - run genhtml for drcov
Posted by Anonymous on Fri 27th Sep 2024 11:07
raw | new post

  1. #!/usr/bin/ksh93
  2.  
  3. #
  4. # drcovlog_genhtml.ksh - run genhtml for drcov
  5. #
  6. # Usage:
  7. # $ drmemory -coverage -light -batch -- "$(cygpath -w /sbin/nfs_mount)"
  8. # $ drcovlog_genhtml.ksh 'C:\Users\roland_mainz\AppData\Roaming\Dr. Memory\DrMemory-nfs_mount.exe.6288.000\drcov.nfs_mount.exe.06288.0000.proc.log'
  9. #
  10.  
  11. function covwinpaths2cygwinpaths
  12. {
  13.     set -o nounset
  14.  
  15.     typeset i
  16.     typeset winpath
  17.     typeset cygwinpath
  18.  
  19.     while read -r i ; do
  20.         if [[ "$i" == ~(El)SF: ]] ; then
  21.             winpath="${i#SF:}"
  22.             cygwinpath="${ cygpath -u "$winpath"; }"
  23.             printf 'SF:%s\n' "$cygwinpath"
  24.         else
  25.             printf '%s\n' "$i"
  26.         fi
  27.     done
  28.     return 0
  29. }
  30.  
  31.  
  32. function main
  33. {
  34.     set -o errexit
  35.     set -o xtrace
  36.  
  37.     which -a drcov2lcov || return 1
  38.     which -a genhtml || return 1
  39.  
  40.     drcov2lcov -input "$1" -output 'coverage_winpaths.info'
  41.     covwinpaths2cygwinpaths <'coverage_winpaths.info' >'coverage_cygwinpaths.info'
  42.  
  43.     rm -Rf coverage_*.info report/
  44.  
  45.     mkdir report
  46.  
  47.     (
  48.         cd report &&
  49.             genhtml -ignore-errors source \
  50.                 --frames \
  51.                 --function-coverage \
  52.                 --branch-coverage \
  53.                 '../coverage_cygwinpaths.info')
  54.     rm 'coverage_winpaths.info'
  55.     rm 'coverage_cygwinpaths.info'
  56.     return 0
  57. }
  58.  
  59. #
  60. # main
  61. #
  62.  
  63. PATH+=':/cygdrive/c/Program Files (x86)/Dr. Memory/dynamorio/tools/bin64/'
  64. PATH+=":$PWD"
  65.  
  66. builtin mkdir
  67.  
  68. main "$@"
  69. # EOF.

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at