Add a loud mode for debugging libFuzzer on mac OS
This commit is contained in:
parent
f9334cdbc6
commit
af4a0a2007
@ -56,6 +56,9 @@ int DeepState_UsingSymExec = 0;
|
||||
/* Set to 1 when we're using libFuzzer. */
|
||||
int DeepState_UsingLibFuzzer = 0;
|
||||
|
||||
/* To make libFuzzer louder on mac OS. */
|
||||
int DeepState_LibFuzzerLoud = 1;
|
||||
|
||||
/* Array of DeepState generated strings. Impossible for there to
|
||||
* be more than there are input bytes. Index stores where we are. */
|
||||
char* DeepState_GeneratedStrings[DeepState_InputSize];
|
||||
@ -841,6 +844,12 @@ extern int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
|
||||
}
|
||||
|
||||
DeepState_UsingLibFuzzer = 1;
|
||||
|
||||
const char* loud = getenv("LIBFUZZER_LOUD");
|
||||
if (loud != NULL) {
|
||||
FLAGS_log_level = 0;
|
||||
DeepState_LibFuzzerLoud = 1;
|
||||
}
|
||||
|
||||
struct DeepState_TestInfo *test = NULL;
|
||||
|
||||
|
||||
@ -69,13 +69,14 @@ enum {
|
||||
};
|
||||
|
||||
extern int DeepState_UsingLibFuzzer;
|
||||
extern int DeepState_LibFuzzerLoud;
|
||||
|
||||
char DeepState_LogBuf[DeepState_LogBufSize + 1] = {};
|
||||
|
||||
/* Log a C string. */
|
||||
DEEPSTATE_NOINLINE
|
||||
void DeepState_Log(enum DeepState_LogLevel level, const char *str) {
|
||||
if ((DeepState_UsingLibFuzzer && (level < DeepState_LogExternal)) ||
|
||||
if ((DeepState_UsingLibFuzzer && !DeepState_LibFuzzerLoud && (level < DeepState_LogExternal)) ||
|
||||
(level < FLAGS_log_level)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user