aboutsummaryrefslogtreecommitdiffstats
path: root/executor
diff options
context:
space:
mode:
authorAnton Lindqvist <anton@basename.se>2018-09-20 11:17:14 +0200
committerDmitry Vyukov <dvyukov@google.com>2018-09-20 11:17:14 +0200
commit5f78ab4b8149c28d68103911a7fc22a9ee79d811 (patch)
tree68cac5ab27d7a1a3a38f68b6119462a4241fb11c /executor
parent25ff1e17d367ded0970d69c3dfdf023302d6ef23 (diff)
executor: move debug_dump_data() into common_linux.h
Compiling the executor on OpenBSD currently fails: executor/executor.cc:1316:6: error: unused function 'debug_dump_data'
Diffstat (limited to 'executor')
-rw-r--r--executor/common_linux.h12
-rw-r--r--executor/executor.cc13
2 files changed, 12 insertions, 13 deletions
diff --git a/executor/common_linux.h b/executor/common_linux.h
index 02c1eb82e..e8ac309c3 100644
--- a/executor/common_linux.h
+++ b/executor/common_linux.h
@@ -13,6 +13,18 @@ struct cover_t;
static void cover_reset(cover_t* cov);
#endif
+static void debug_dump_data(const char* data, int length)
+{
+ if (!flag_debug)
+ return;
+ for (int i = 0; i < length; i++) {
+ debug("%02x ", data[i] & 0xff);
+ if (i % 16 == 15)
+ debug("\n");
+ }
+ debug("\n");
+}
+
#if SYZ_EXECUTOR || SYZ_THREADED
#include <linux/futex.h>
#include <pthread.h>
diff --git a/executor/executor.cc b/executor/executor.cc
index 55a77f423..a72c48add 100644
--- a/executor/executor.cc
+++ b/executor/executor.cc
@@ -70,7 +70,6 @@ static NORETURN PRINTF void error(const char* msg, ...);
static NORETURN PRINTF void exitf(const char* msg, ...);
// Print debug output, does not add \n at the end of msg as opposed to the previous functions.
static PRINTF void debug(const char* msg, ...);
-static void debug_dump_data(const char* data, int length);
static NORETURN void doexit(int status);
static void receive_execute();
@@ -1312,15 +1311,3 @@ void debug(const char* msg, ...)
va_end(args);
fflush(stderr);
}
-
-void debug_dump_data(const char* data, int length)
-{
- if (!flag_debug)
- return;
- for (int i = 0; i < length; i++) {
- debug("%02x ", data[i] & 0xff);
- if (i % 16 == 15)
- debug("\n");
- }
- debug("\n");
-}