[Lldb-commits] [lldb] 6c5c4a2 - [lldb/Reproducers] Also collect ::open and ::fopen

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Tue Jun 9 11:59:09 PDT 2020


Author: Jonas Devlieghere
Date: 2020-06-09T11:59:02-07:00
New Revision: 6c5c4a2a50e1fcdd94c0288008af65c544a96452

URL: https://github.com/llvm/llvm-project/commit/6c5c4a2a50e1fcdd94c0288008af65c544a96452
DIFF: https://github.com/llvm/llvm-project/commit/6c5c4a2a50e1fcdd94c0288008af65c544a96452.diff

LOG: [lldb/Reproducers] Also collect ::open  and ::fopen

Report files opened trough ::open and ::fopen to the FileCollector.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/lldb/source/Host/posix/FileSystemPosix.cpp b/lldb/source/Host/posix/FileSystemPosix.cpp
index 3660f67895a4..0aa34bc59435 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 cbd1915bdb44..94872c99b15e 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;


        


More information about the lldb-commits mailing list