[lldb/Reproducers] Also collect ::open and ::fopen
authorJonas Devlieghere <jonas@devlieghere.com>
Tue, 9 Jun 2020 18:58:22 +0000 (11:58 -0700)
committerJonas Devlieghere <jonas@devlieghere.com>
Tue, 9 Jun 2020 18:59:02 +0000 (11:59 -0700)
Report files opened trough ::open and ::fopen to the FileCollector.

lldb/source/Host/posix/FileSystemPosix.cpp
lldb/source/Host/windows/FileSystem.cpp

index 3660f67..0aa34bc 100644 (file)
@@ -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);
 }
index cbd1915..94872c9 100644 (file)
@@ -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;