mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-02 15:16:08 +00:00
[libFuzzer] print uncovered functions when doing -print_coverage=1
llvm-svn: 352263
This commit is contained in:
parent
2b8b2978e4
commit
bb01a098b1
@ -245,8 +245,7 @@ void TracePC::IterateCoveredFunctions(CallBack CB) {
|
|||||||
do {
|
do {
|
||||||
NextFE++;
|
NextFE++;
|
||||||
} while (NextFE < M.Stop && !(NextFE->PCFlags & 1));
|
} while (NextFE < M.Stop && !(NextFE->PCFlags & 1));
|
||||||
if (ObservedFuncs.count(FE->PC))
|
CB(FE, NextFE, ObservedFuncs[FE->PC]);
|
||||||
CB(FE, NextFE, ObservedFuncs[FE->PC]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -311,12 +310,13 @@ void TracePC::PrintCoverage() {
|
|||||||
for (auto TE = First; TE < Last; TE++)
|
for (auto TE = First; TE < Last; TE++)
|
||||||
if (!ObservedPCs.count(TE->PC))
|
if (!ObservedPCs.count(TE->PC))
|
||||||
UncoveredPCs.push_back(TE->PC);
|
UncoveredPCs.push_back(TE->PC);
|
||||||
Printf("COVERED_FUNC: hits: %zd", Counter);
|
Printf("%sCOVERED_FUNC: hits: %zd", Counter ? "" : "UN", Counter);
|
||||||
Printf(" edges: %zd/%zd", NumEdges - UncoveredPCs.size(), NumEdges);
|
Printf(" edges: %zd/%zd", NumEdges - UncoveredPCs.size(), NumEdges);
|
||||||
Printf(" %s %s:%zd\n", FunctionStr.c_str(), FileStr.c_str(), Line);
|
Printf(" %s %s:%zd\n", FunctionStr.c_str(), FileStr.c_str(), Line);
|
||||||
for (auto PC: UncoveredPCs)
|
if (Counter)
|
||||||
Printf(" UNCOVERED_PC: %s\n",
|
for (auto PC : UncoveredPCs)
|
||||||
DescribePC("%s:%l", GetNextInstructionPc(PC)).c_str());
|
Printf(" UNCOVERED_PC: %s\n",
|
||||||
|
DescribePC("%s:%l", GetNextInstructionPc(PC)).c_str());
|
||||||
};
|
};
|
||||||
|
|
||||||
IterateCoveredFunctions(CoveredFunctionCallback);
|
IterateCoveredFunctions(CoveredFunctionCallback);
|
||||||
|
@ -17,3 +17,4 @@ DSO-DAG: COVERED_FUNC:{{.*}}LLVMFuzzerTestOneInput{{.*}}DSOTestMain
|
|||||||
DSO-DAG: UNCOVERED_PC:{{.*}}1
|
DSO-DAG: UNCOVERED_PC:{{.*}}1
|
||||||
DSO-DAG: UNCOVERED_PC:{{.*}}2
|
DSO-DAG: UNCOVERED_PC:{{.*}}2
|
||||||
DSO-DAG: UNCOVERED_PC:{{.*}}DSOTestMain
|
DSO-DAG: UNCOVERED_PC:{{.*}}DSOTestMain
|
||||||
|
DSO-DAG: UNCOVERED_FUNC:{{.*}}Uncovered1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user