aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Fuzzer/FuzzerIO.cpp
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2015-05-05 21:59:51 +0000
committerKostya Serebryany <kcc@google.com>2015-05-05 21:59:51 +0000
commitca6a2a2f1ca1419ee3e695567022fe883a57690e (patch)
treea19b7900e542b05c5b83e31b7bb77a6e6b5a4c93 /llvm/lib/Fuzzer/FuzzerIO.cpp
parent6d721fa28c868eaaf06ab417131c10d13c3ed10f (diff)
downloadllvm-ca6a2a2f1ca1419ee3e695567022fe883a57690e.zip
llvm-ca6a2a2f1ca1419ee3e695567022fe883a57690e.tar.gz
llvm-ca6a2a2f1ca1419ee3e695567022fe883a57690e.tar.bz2
[lib/Fuzzer] on crash print the contents of the crashy input as base64
llvm-svn: 236548
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerIO.cpp')
-rw-r--r--llvm/lib/Fuzzer/FuzzerIO.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerIO.cpp b/llvm/lib/Fuzzer/FuzzerIO.cpp
index ef23d42e..81f37aa 100644
--- a/llvm/lib/Fuzzer/FuzzerIO.cpp
+++ b/llvm/lib/Fuzzer/FuzzerIO.cpp
@@ -60,4 +60,9 @@ std::string DirPlusFile(const std::string &DirPath,
return DirPath + "/" + FileName;
}
+void PrintFileAsBase64(const std::string &Path) {
+ std::string Cmd = "base64 -w 0 < " + Path + "; echo";
+ system(Cmd.c_str());
+}
+
} // namespace fuzzer