about summary refs log tree commit diff
path: root/src/afl-cc.c
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2021-01-05 12:30:26 +0100
committervan Hauser <vh@thc.org>2021-01-05 12:30:26 +0100
commit6b54310452a1b743a90ad45fcc511f59dd7821ec (patch)
tree8f9aa85ee1de33a56a486d1300064c8bf7493fed /src/afl-cc.c
parentcaf1fbd6323f4069bed20e386d425e529be48a27 (diff)
downloadafl++-6b54310452a1b743a90ad45fcc511f59dd7821ec.tar.gz
selective instrumentation documented
Diffstat (limited to 'src/afl-cc.c')
-rw-r--r--src/afl-cc.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/afl-cc.c b/src/afl-cc.c
index db2dcd14..964df57f 100644
--- a/src/afl-cc.c
+++ b/src/afl-cc.c
@@ -828,6 +828,20 @@ static void edit_params(u32 argc, char **argv, char **envp) {
       "unsigned char __afl_fuzz_alt[1048576];"
       "unsigned char *__afl_fuzz_alt_ptr = __afl_fuzz_alt;";
   cc_params[cc_par_cnt++] =
+      "-D__AFL_COVERAGE()=int __afl_selective_coverage = 1;"
+      "void __afl_coverage_discard();"
+      "void __afl_coverage_abort();"
+      "void __afl_coverage_on();"
+      "void __afl_coverage_off();";
+  cc_params[cc_par_cnt++] =
+      "-D__AFL_COVERAGE_START_OFF()=int __afl_selective_coverage_start_off = "
+      "1;";
+  cc_params[cc_par_cnt++] = "-D__AFL_COVERAGE_ON()=__afl_coverage_on()";
+  cc_params[cc_par_cnt++] = "-D__AFL_COVERAGE_OFF()=__afl_coverage_off()";
+  cc_params[cc_par_cnt++] =
+      "-D__AFL_COVERAGE_DISCARD()=__afl_coverage_discard()";
+  cc_params[cc_par_cnt++] = "-D__AFL_COVERAGE_ABORT()=__afl_coverage_abort()";
+  cc_params[cc_par_cnt++] =
       "-D__AFL_FUZZ_TESTCASE_BUF=(__afl_fuzz_ptr ? __afl_fuzz_ptr : "
       "__afl_fuzz_alt_ptr)";
   cc_params[cc_par_cnt++] =