mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-01 15:17:25 +00:00
[lib/Fuzzer] when -sync_command=<CMD> is given, periodically execute 'CMD CORPUS' to synchronize with other processes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237617 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -43,6 +43,7 @@ void PrintASCII(const Unit &U, const char *PrintAfter = "");
|
||||
std::string Hash(const Unit &U);
|
||||
void SetTimer(int Seconds);
|
||||
void PrintFileAsBase64(const std::string &Path);
|
||||
void ExecuteCommand(const std::string &Command);
|
||||
|
||||
// Private copy of SHA1 implementation.
|
||||
static const int kSHA1NumBytes = 20;
|
||||
@@ -66,7 +67,9 @@ class Fuzzer {
|
||||
bool Reload = true;
|
||||
int PreferSmallDuringInitialShuffle = -1;
|
||||
size_t MaxNumberOfRuns = ULONG_MAX;
|
||||
int SyncTimeout = 600;
|
||||
std::string OutputCorpus;
|
||||
std::string SyncCommand;
|
||||
std::vector<std::string> Tokens;
|
||||
};
|
||||
Fuzzer(UserCallback Callback, FuzzingOptions Options);
|
||||
@@ -108,6 +111,8 @@ class Fuzzer {
|
||||
void PrintStats(const char *Where, size_t Cov, const char *End = "\n");
|
||||
void PrintUnitInASCIIOrTokens(const Unit &U, const char *PrintAfter = "");
|
||||
|
||||
void SyncCorpus();
|
||||
|
||||
// Trace-based fuzzing: we run a unit with some kind of tracing
|
||||
// enabled and record potentially useful mutations. Then
|
||||
// We apply these mutations one by one to the unit and run it again.
|
||||
@@ -142,6 +147,7 @@ class Fuzzer {
|
||||
UserCallback Callback;
|
||||
FuzzingOptions Options;
|
||||
system_clock::time_point ProcessStartTime = system_clock::now();
|
||||
system_clock::time_point LastExternalSync = system_clock::now();
|
||||
system_clock::time_point UnitStartTime;
|
||||
long TimeOfLongestUnitInSeconds = 0;
|
||||
long EpochOfLastReadOfOutputCorpus = 0;
|
||||
|
||||
Reference in New Issue
Block a user