summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Fuzzer/FuzzerLoop.cpp
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2016-09-30 01:24:57 +0000
committerKostya Serebryany <kcc@google.com>2016-09-30 01:24:57 +0000
commitb3949ef88534b0f87d1cd675adf6582dfbf6cae5 (patch)
treedf0530c32b7ddc88c2670338367528ee90beed08 /llvm/lib/Fuzzer/FuzzerLoop.cpp
parent190947e9685339abcaba2aa6435313e87dad16c0 (diff)
downloadbcm5719-llvm-b3949ef88534b0f87d1cd675adf6582dfbf6cae5.tar.gz
bcm5719-llvm-b3949ef88534b0f87d1cd675adf6582dfbf6cae5.zip
[libFuzzer] remove the code for -print_pcs=1 with the old coverage. It still works with the new one (trace-pc-guard)
llvm-svn: 282831
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerLoop.cpp')
-rw-r--r--llvm/lib/Fuzzer/FuzzerLoop.cpp39
1 files changed, 2 insertions, 37 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerLoop.cpp b/llvm/lib/Fuzzer/FuzzerLoop.cpp
index 8ef86f22ff1..f7d0b156a5b 100644
--- a/llvm/lib/Fuzzer/FuzzerLoop.cpp
+++ b/llvm/lib/Fuzzer/FuzzerLoop.cpp
@@ -63,11 +63,8 @@ void Fuzzer::ResetEdgeCoverage() {
}
void Fuzzer::ResetCounters() {
- if (Options.UseCounters) {
+ if (Options.UseCounters)
EF->__sanitizer_update_counter_bitset_and_clear_counters(0);
- }
- if (EF->__sanitizer_get_coverage_pc_buffer_pos)
- PcBufferPos = EF->__sanitizer_get_coverage_pc_buffer_pos();
}
void Fuzzer::PrepareCounters(Fuzzer::Coverage *C) {
@@ -116,19 +113,6 @@ bool Fuzzer::RecordMaxCoverage(Fuzzer::Coverage *C) {
if (TPC.UpdateValueProfileMap(&C->VPMap))
Res = true;
- if (EF->__sanitizer_get_coverage_pc_buffer_pos) {
- uint64_t NewPcBufferPos = EF->__sanitizer_get_coverage_pc_buffer_pos();
- if (NewPcBufferPos > PcBufferPos) {
- Res = true;
- PcBufferPos = NewPcBufferPos;
- }
-
- if (PcBufferLen && NewPcBufferPos >= PcBufferLen) {
- Printf("ERROR: PC buffer overflow\n");
- _Exit(1);
- }
- }
-
return Res;
}
@@ -171,11 +155,6 @@ Fuzzer::Fuzzer(UserCallback CB, InputCorpus &Corpus, MutationDispatcher &MD,
TPC.SetUseCounters(Options.UseCounters);
TPC.SetUseValueProfile(Options.UseValueProfile);
- if (Options.PrintNewCovPcs) {
- PcBufferLen = 1 << 24;
- PcBuffer = new uintptr_t[PcBufferLen];
- EF->__sanitizer_set_coverage_pc_buffer(PcBuffer, PcBufferLen);
- }
if (Options.Verbosity)
TPC.PrintModuleInfo();
if (!Options.OutputCorpus.empty() && Options.Reload)
@@ -451,18 +430,11 @@ void Fuzzer::ShuffleAndMinimize(UnitVector *InitialCorpus) {
}
}
-bool Fuzzer::UpdateMaxCoverage() {
- PrevPcBufferPos = PcBufferPos;
- bool Res = RecordMaxCoverage(&MaxCoverage);
-
- return Res;
-}
-
bool Fuzzer::RunOne(const uint8_t *Data, size_t Size) {
TotalNumberOfRuns++;
ExecuteCallback(Data, Size);
- bool Res = UpdateMaxCoverage();
+ bool Res = RecordMaxCoverage(&MaxCoverage);
auto TimeOfUnit =
duration_cast<seconds>(UnitStopTime - UnitStartTime).count();
@@ -561,13 +533,6 @@ void Fuzzer::PrintOneNewPC(uintptr_t PC) {
void Fuzzer::PrintNewPCs() {
if (!Options.PrintNewCovPcs) return;
- if (PrevPcBufferPos != PcBufferPos) {
- int NumPrinted = 0;
- for (size_t I = PrevPcBufferPos; I < PcBufferPos; ++I) {
- if (NumPrinted++ > 30) break; // Don't print too many new PCs.
- PrintOneNewPC(PcBuffer[I]);
- }
- }
uintptr_t *PCIDs;
if (size_t NumNewPCIDs = TPC.GetNewPCIDs(&PCIDs))
for (size_t i = 0; i < NumNewPCIDs; i++)
OpenPOWER on IntegriCloud