diff options
| author | Kostya Serebryany <kcc@google.com> | 2016-10-26 00:20:51 +0000 |
|---|---|---|
| committer | Kostya Serebryany <kcc@google.com> | 2016-10-26 00:20:51 +0000 |
| commit | a5b2e54fcb7d271ba2d92eda1d9c7cb9a4c4d6da (patch) | |
| tree | 9781700dad8ffecf2b54fd7276c8490678d4b9c0 /llvm/lib/Fuzzer/FuzzerTracePC.cpp | |
| parent | 2515740b70e37ec11c04bff7c8b5dd096402e0ab (diff) | |
| download | bcm5719-llvm-a5b2e54fcb7d271ba2d92eda1d9c7cb9a4c4d6da.tar.gz bcm5719-llvm-a5b2e54fcb7d271ba2d92eda1d9c7cb9a4c4d6da.zip | |
[libFuzzer] simplify the code to print new PCs
llvm-svn: 285145
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerTracePC.cpp')
| -rw-r--r-- | llvm/lib/Fuzzer/FuzzerTracePC.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerTracePC.cpp b/llvm/lib/Fuzzer/FuzzerTracePC.cpp index e17a10b55c7..9e612470874 100644 --- a/llvm/lib/Fuzzer/FuzzerTracePC.cpp +++ b/llvm/lib/Fuzzer/FuzzerTracePC.cpp @@ -136,6 +136,16 @@ static bool IsInterestingCoverageFile(std::string &File) { return true; } +void TracePC::PrintNewPCs() { + if (DoPrintNewPCs) { + if (!PrintedPCs) + PrintedPCs = new std::set<uintptr_t>; + for (size_t i = 0; i < Min(NumGuards + 1, kNumPCs); i++) + if (PCs[i] && PrintedPCs->insert(PCs[i]).second) + PrintPC("\tNEW_PC: %p %F %L\n", "\tNEW_PC: %p\n", PCs[i]); + } +} + void TracePC::PrintCoverage() { if (!EF->__sanitizer_symbolize_pc) { Printf("INFO: __sanitizer_symbolize_pc is not available," |

