From b25fc7b83119e8dca728a199fd92e24dd4c33fa4 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 26 Jul 2018 19:38:24 +0200 Subject: pkg/csource: add option to trace syscall results This will be needed for testing of generated programs. --- executor/common.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'executor/common.h') diff --git a/executor/common.h b/executor/common.h index 9e6545926..1b9afd074 100644 --- a/executor/common.h +++ b/executor/common.h @@ -21,6 +21,10 @@ #include #include +#if SYZ_TRACE +#include +#endif + #if SYZ_EXECUTOR && !GOOS_linux #include NORETURN void doexit(int status) @@ -395,6 +399,9 @@ static void loop() #if SYZ_REPRO if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } +#endif +#if SYZ_TRACE + printf("### start\n"); #endif int call, thread; #if SYZ_COLLIDE @@ -470,7 +477,11 @@ static void loop() fail("pipe failed"); #endif int iter; +#if SYZ_REPEAT_TIMES + for (iter = 0; iter < [[REPEAT_TIMES]]; iter++) { +#else for (iter = 0;; iter++) { +#endif #if SYZ_EXECUTOR || SYZ_USE_TMP_DIR // Create a new private work dir for this test (removed at the end of the loop). char cwdbuf[32]; -- cgit mrf-deployment