From 6c5c4a2a50e1fcdd94c0288008af65c544a96452 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Tue, 9 Jun 2020 11:58:22 -0700 Subject: [PATCH] [lldb/Reproducers] Also collect ::open and ::fopen Report files opened trough ::open and ::fopen to the FileCollector. --- lldb/source/Host/posix/FileSystemPosix.cpp | 2 ++ lldb/source/Host/windows/FileSystem.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lldb/source/Host/posix/FileSystemPosix.cpp b/lldb/source/Host/posix/FileSystemPosix.cpp index 3660f67..0aa34bc 100644 --- a/lldb/source/Host/posix/FileSystemPosix.cpp +++ b/lldb/source/Host/posix/FileSystemPosix.cpp @@ -72,9 +72,11 @@ Status FileSystem::ResolveSymbolicLink(const FileSpec &src, FileSpec &dst) { } FILE *FileSystem::Fopen(const char *path, const char *mode) { + Collect(path); return llvm::sys::RetryAfterSignal(nullptr, ::fopen, path, mode); } int FileSystem::Open(const char *path, int flags, int mode) { + Collect(path); return llvm::sys::RetryAfterSignal(-1, ::open, path, flags, mode); } diff --git a/lldb/source/Host/windows/FileSystem.cpp b/lldb/source/Host/windows/FileSystem.cpp index cbd1915..94872c9 100644 --- a/lldb/source/Host/windows/FileSystem.cpp +++ b/lldb/source/Host/windows/FileSystem.cpp @@ -86,6 +86,7 @@ Status FileSystem::ResolveSymbolicLink(const FileSpec &src, FileSpec &dst) { } FILE *FileSystem::Fopen(const char *path, const char *mode) { + Collect(path); std::wstring wpath, wmode; if (!llvm::ConvertUTF8toWide(path, wpath)) return nullptr; @@ -98,6 +99,7 @@ FILE *FileSystem::Fopen(const char *path, const char *mode) { } int FileSystem::Open(const char *path, int flags, int mode) { + Collect(path); std::wstring wpath; if (!llvm::ConvertUTF8toWide(path, wpath)) return -1; -- 2.7.4