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

Report files opened trough ::open and ::fopen to the FileCollector.
This commit is contained in:
Jonas Devlieghere 2020-06-09 11:58:22 -07:00
parent d31c9e5a46
commit 6c5c4a2a50
2 changed files with 4 additions and 0 deletions

View 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);
}

View 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;