mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-13 02:28:09 +00:00
fix LTO document id feature, warnings for INSTRUMENT_FILE
This commit is contained in:
@ -206,8 +206,8 @@ bool AFLLTOPass::runOnModule(Module &M) {
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"DEBUG: Function %s is not the instrument file listed\n",
|
"DEBUG: Function %s is not in a source file that was specified "
|
||||||
F.getName().str().c_str());
|
"in the instrument file list\n", F.getName().str().c_str());
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -660,10 +660,11 @@ bool AFLLTOPass::runOnModule(Module &M) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (documentFile) fclose(documentFile);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (documentFile) fclose(documentFile);
|
||||||
|
documentFile = NULL;
|
||||||
|
|
||||||
// save highest location ID to global variable
|
// save highest location ID to global variable
|
||||||
// do this after each function to fail faster
|
// do this after each function to fail faster
|
||||||
if (!be_quiet && afl_global_id > MAP_SIZE &&
|
if (!be_quiet && afl_global_id > MAP_SIZE &&
|
||||||
|
@ -164,32 +164,41 @@ bool AFLcheckIfInstrument::runOnModule(Module &M) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (instFilename.str().empty()) {
|
||||||
|
|
||||||
|
if (!be_quiet)
|
||||||
|
WARNF(
|
||||||
|
"Function %s has no source file name information and will "
|
||||||
|
"not be instrumented.",
|
||||||
|
F.getName().str().c_str());
|
||||||
|
continue;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
(void)instLine;
|
//(void)instLine;
|
||||||
|
|
||||||
|
fprintf(stderr, "xxx %s %s\n", F.getName().str().c_str(),
|
||||||
|
instFilename.str().c_str());
|
||||||
if (debug)
|
if (debug)
|
||||||
SAYF(cMGN "[D] " cRST "function %s is in file %s\n",
|
SAYF(cMGN "[D] " cRST "function %s is in file %s\n",
|
||||||
F.getName().str().c_str(), instFilename.str().c_str());
|
F.getName().str().c_str(), instFilename.str().c_str());
|
||||||
/* Continue only if we know where we actually are */
|
|
||||||
if (!instFilename.str().empty()) {
|
|
||||||
|
|
||||||
for (std::list<std::string>::iterator it = myInstrumentList.begin();
|
for (std::list<std::string>::iterator it = myInstrumentList.begin();
|
||||||
it != myInstrumentList.end(); ++it) {
|
it != myInstrumentList.end(); ++it) {
|
||||||
|
|
||||||
/* We don't check for filename equality here because
|
/* We don't check for filename equality here because
|
||||||
* filenames might actually be full paths. Instead we
|
* filenames might actually be full paths. Instead we
|
||||||
* check that the actual filename ends in the filename
|
* check that the actual filename ends in the filename
|
||||||
* specified in the list. */
|
* specified in the list. */
|
||||||
if (instFilename.str().length() >= it->length()) {
|
if (instFilename.str().length() >= it->length()) {
|
||||||
|
|
||||||
if (fnmatch(("*" + *it).c_str(), instFilename.str().c_str(), 0) ==
|
if (fnmatch(("*" + *it).c_str(), instFilename.str().c_str(), 0) ==
|
||||||
0) {
|
0) {
|
||||||
|
|
||||||
instrumentFunction = true;
|
instrumentFunction = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -197,6 +206,13 @@ bool AFLcheckIfInstrument::runOnModule(Module &M) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if (!be_quiet)
|
||||||
|
WARNF("No debug information found for function %s, recompile with -g",
|
||||||
|
F.getName().str().c_str());
|
||||||
|
continue;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Either we couldn't figure out our location or the location is
|
/* Either we couldn't figure out our location or the location is
|
||||||
|
Reference in New Issue
Block a user