@@ -60,7 +60,6 @@ def main():
6060 if cargs .version :
6161 print "afl-cov-" + __version__
6262 return exit_success
63-
6463 if cargs .gcov_check or cargs .gcov_check_bin :
6564 if is_gcov_enabled (cargs ):
6665 return exit_success
@@ -575,6 +574,8 @@ def lcov_gen_coverage(cov_paths, cargs):
575574 lcov_opts += ' --rc lcov_branch_coverage=1'
576575 if cargs .follow :
577576 lcov_opts += ' --follow'
577+ if cargs .clang :
578+ lcov_opts += ' --gcov-tool afl-cov--wrapper '
578579
579580 run_cmd (cargs .lcov_path \
580581 + lcov_opts
@@ -800,6 +801,8 @@ def init_tracking(cov_paths, cargs):
800801 lcov_opts = ''
801802 if cargs .enable_branch_coverage :
802803 lcov_opts += ' --rc lcov_branch_coverage=1 '
804+ if cargs .clang :
805+ lcov_opts += ' --gcov-tool afl-cov--wrapper '
803806
804807 ### reset code coverage counters - this is done only once as
805808 ### afl-cov is spinning up even if AFL is running in parallel mode
@@ -1204,6 +1207,8 @@ def parse_cmdline():
12041207 help = "Print version and exit" , default = False )
12051208 p .add_argument ("-q" , "--quiet" , action = 'store_true' ,
12061209 help = "Quiet mode" , default = False )
1210+ p .add_argument ("--clang" , action = 'store_true' ,
1211+ help = "Support clang-based (afl-clang-fast) instrumentation" , default = False )
12071212
12081213 return p .parse_args ()
12091214
0 commit comments