1 //
2 //                     The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 // fuzzer::FuzzingOptions
9 //===----------------------------------------------------------------------===//
10 
11 #ifndef LLVM_FUZZER_OPTIONS_H
12 #define LLVM_FUZZER_OPTIONS_H
13 
14 #include "FuzzerDefs.h"
15 
16 namespace fuzzer {
17 
18 struct FuzzingOptions {
19   int Verbosity = 1;
20   size_t MaxLen = 0;
21   size_t LenControl = 1000;
22   int UnitTimeoutSec = 300;
23   int TimeoutExitCode = 77;
24   int ErrorExitCode = 77;
25   int MaxTotalTimeSec = 0;
26   int RssLimitMb = 0;
27   int MallocLimitMb = 0;
28   bool DoCrossOver = true;
29   int MutateDepth = 5;
30   bool ReduceDepth = false;
31   bool UseCounters = false;
32   bool UseMemmem = true;
33   bool UseCmp = false;
34   int UseValueProfile = false;
35   bool Shrink = false;
36   bool ReduceInputs = false;
37   int ReloadIntervalSec = 1;
38   bool ShuffleAtStartUp = true;
39   bool PreferSmall = true;
40   size_t MaxNumberOfRuns = -1L;
41   int ReportSlowUnits = 10;
42   bool OnlyASCII = false;
43   std::string OutputCorpus;
44   std::string ArtifactPrefix = "./";
45   std::string ExactArtifactPath;
46   std::string ExitOnSrcPos;
47   std::string ExitOnItem;
48   std::string FocusFunction;
49   std::string DataFlowTrace;
50   bool SaveArtifacts = true;
51   bool PrintNEW = true; // Print a status line when new units are found;
52   bool PrintNewCovPcs = false;
53   int PrintNewCovFuncs = 0;
54   bool PrintFinalStats = false;
55   bool PrintCorpusStats = false;
56   bool PrintCoverage = false;
57   bool DumpCoverage = false;
58   bool DetectLeaks = true;
59   int PurgeAllocatorIntervalSec = 1;
60   int  TraceMalloc = 0;
61   bool HandleAbrt = false;
62   bool HandleBus = false;
63   bool HandleFpe = false;
64   bool HandleIll = false;
65   bool HandleInt = false;
66   bool HandleSegv = false;
67   bool HandleTerm = false;
68   bool HandleXfsz = false;
69   bool HandleUsr1 = false;
70   bool HandleUsr2 = false;
71 };
72 
73 }  // namespace fuzzer
74 
75 #endif  // LLVM_FUZZER_OPTIONS_H
76