summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Fuzzer/FuzzerIOWindows.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [libFuzzer] Delete llvm/lib/FuzzerVitaly Buka2017-10-161-323/+0
| | | | | | | | | | | | Summary: Code is already in compiler-rt Reviewers: kcc Subscribers: krytarowski, llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D38912 llvm-svn: 315937
* [LibFuzzer] Fix `-Wcomment` warning emitted by GCC.Dan Liew2017-07-111-2/+2
| | | | | | | | | | | | | | | ``` ./FuzzerIOWindows.cpp:185:1: warning: multi-line comment [-Wcomment] // Parse a directory ending in separator, like: SomeDir\ ^ ./FuzzerIOWindows.cpp:200:1: warning: multi-line comment [-Wcomment] // Parse a servername and share, like: SomeServer\SomeShare\ ^ ``` Differential Revision: https://reviews.llvm.org/D35244 llvm-svn: 307687
* [libFuzzer] Properly use Handle instead of FD on Windows.Marcos Pividori2017-02-081-0/+4
| | | | | | | | | | | For Windows, sanitizers work with Handles, not with posix file descriptors, because they use the windows-specific API. So we need to convert the fds to handles before passing them to the sanitizer library. After this change, close_fd_mask is fixed for Windows (this fix some tests too). Differential Revision: https://reviews.llvm.org/D29548 llvm-svn: 294388
* [libFuzzer] Implement TmpDir() for Windows.Marcos Pividori2017-01-301-1/+11
| | | | | | Differential Revision: https://reviews.llvm.org/D28977 llvm-svn: 293516
* [libFuzzer] simplify the code for __sanitizer_cov_trace_pc_guard and make ↵Kostya Serebryany2017-01-261-0/+5
| | | | | | sure it is not asan/msan-instrumented llvm-svn: 293125
* [libFuzzer] Avoid undefined behavior, properly discard output to stdout/stderr.Marcos Pividori2017-01-221-0/+8
| | | | | | | | | | | | | | | | | | | | | | Fix libFuzzer when setting -close_fd_mask to a non-zero value. In previous implementation, libFuzzer closes the file descriptors for stdout/stderr. This has some disavantages: For `fuzzer-fdmask.test`, we write directly to stdout and stderr using the file streams stdout and stderr, after the file descriptors are closed, which is undefined behavior. In Windows, in particular, this was making the test fail. Also, if we close stdout and we open a new file in libFuzzer, we get the file descriptor 1, which could generate problem if some code assumes file descriptors refers to stdout and works directly writing to the file descriptor 1, but it will be writing to the opened file (for example using std::cout). Instead of closing the file descriptors, I redirect the output to /dev/null on linux and nul on Windows. Differential Revision: https://reviews.llvm.org/D28718 llvm-svn: 292743
* [libFuzzer] Fix ListFilesInDirRecursive() to do the same for Posix and Windows.Marcos Pividori2017-01-221-2/+4
| | | | | | | | | Update `ListFilesInDirRecursive` implementation on Windows to have the same behavior than for Posix, when the directory doesn't exists and when it is empty. Differential Revision: https://reviews.llvm.org/D28711 llvm-svn: 292741
* [libFuzzer] Portable implementation of `IsInterestingCoverageFile()`.Marcos Pividori2017-01-221-0/+10
| | | | | | | | For Posix systems and Windows, we need to consider different cases. Differential Revision: https://reviews.llvm.org/D28633 llvm-svn: 292738
* [libFuzzer] use /tmp (or $TMPDIR, if present) to store temp files during mergeKostya Serebryany2017-01-051-0/+2
| | | | llvm-svn: 291078
* [libFuzzer] Avoid name collision with Windows API.Marcos Pividori2016-12-131-1/+1
| | | | | | | | | | Windows uses some macros to replace DeleteFile() by DeleteFileA() or DeleteFileW(). This was causing an error at link time. DeleteFile was renamed to RemoveFile(). Differential Revision: https://reviews.llvm.org/D27577 llvm-svn: 289563
* [libFuzzer] Implement DirName() for Windows.Marcos Pividori2016-12-131-1/+135
| | | | | | | | | | | | | | | | | | | | Implement DirName from scratch to avoid dependencies on external libraries. It's based on MSDN documentation for Naming Files, Paths, and Namespaces. The algorithm can't simply start from the end and look backwards for the first separator, because we need to preserve the prefix that represent the root location. We shouldn't remove anything there. In Windows we have many different options, like: \\Server\Share\ , \ , C: , C:\ , \\?\C:\ , \\?\UNC\Server\Share\ We remove the last separator in the rest of the path, if it exists. It was implemented to have a similar behaviour to dirname() in linux, removing trailing separators, returning "." when the path doesn't contain separators, etc. Differential Revision: https://reviews.llvm.org/D27579 llvm-svn: 289562
* [libFuzzer] Clean up headers and file formatting of LibFuzzer files.Marcos Pividori2016-12-131-2/+3
| | | | | | | | | | | | Reorganize #includes to follow LLVM Coding Standards. Include some missing headers. Required to use `Printf()`. Aside from that, this patch contains no functional change. It is purely a re-organization. Differential Revision: https://reviews.llvm.org/D27363 llvm-svn: 289560
* [libFuzzer] extend -print_coverage to print the comma-separated list of ↵Kostya Serebryany2016-11-301-0/+4
| | | | | | covered dirs. Note: the Windows stub for DirName is left unimplemented llvm-svn: 288276
* [LibFuzzer] Add Windows implementations of some IO functions.Zachary Turner2016-11-301-0/+143
This patch moves some posix specific file i/o code into a new file, FuzzerIOPosix.cpp, and provides implementations for these functions on Windows in FuzzerIOWindows.cpp. This is another incremental step towards getting libfuzzer working on Windows, although it still should not be expected to be fully working. Patch by Marcos Pividori Differential Revision: https://reviews.llvm.org/D27233 llvm-svn: 288275
OpenPOWER on IntegriCloud