MCPcopy Create free account
hub / github.com/HexHive/NASS / PrintModuleInfo

Method PrintModuleInfo

fuzz/libfuzzer/FuzzerTracePC.cpp:80–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80void TracePC::PrintModuleInfo() {
81 if (NumModules) {
82 Printf("INFO: Loaded %zd modules (%zd inline 8-bit counters): ",
83 NumModules, NumInline8bitCounters);
84 for (size_t i = 0; i < NumModules; i++)
85 Printf("%zd [%p, %p), ", Modules[i].Size(), Modules[i].Start(),
86 Modules[i].Stop());
87 Printf("\n");
88 }
89 if (NumPCTables) {
90 Printf("INFO: Loaded %zd PC tables (%zd PCs): ", NumPCTables,
91 NumPCsInPCTables);
92 for (size_t i = 0; i < NumPCTables; i++) {
93 Printf("%zd [%p,%p), ", ModulePCTable[i].Stop - ModulePCTable[i].Start,
94 ModulePCTable[i].Start, ModulePCTable[i].Stop);
95 }
96 Printf("\n");
97
98 if (NumInline8bitCounters && NumInline8bitCounters != NumPCsInPCTables) {
99 Printf("ERROR: The size of coverage PC tables does not match the\n"
100 "number of instrumented PCs. This might be a compiler bug,\n"
101 "please contact the libFuzzer developers.\n"
102 "Also check https://bugs.llvm.org/show_bug.cgi?id=34636\n"
103 "for possible workarounds (tl;dr: don't use the old GNU ld)\n");
104 _Exit(1);
105 }
106 }
107 if (size_t NumExtraCounters = ExtraCountersEnd() - ExtraCountersBegin())
108 Printf("INFO: %zd Extra Counters\n", NumExtraCounters);
109
110 size_t MaxFeatures = CollectFeatures([](uint32_t) {});
111 if (MaxFeatures > std::numeric_limits<uint32_t>::max())
112 Printf("WARNING: The coverage PC tables may produce up to %zu features.\n"
113 "This exceeds the maximum 32-bit value. Some features may be\n"
114 "ignored, and fuzzing may become less precise. If possible,\n"
115 "consider refactoring the fuzzer into several smaller fuzzers\n"
116 "linked against only a portion of the current target.\n",
117 MaxFeatures);
118}
119
120ATTRIBUTE_NO_SANITIZE_ALL
121void TracePC::HandleCallerCallee(uintptr_t Caller, uintptr_t Callee) {

Callers 1

FuzzerMethod · 0.80

Calls 6

SizeMethod · 0.80
PrintfFunction · 0.70
ExtraCountersEndFunction · 0.70
ExtraCountersBeginFunction · 0.70
StartMethod · 0.45
StopMethod · 0.45

Tested by

no test coverage detected