mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-10 19:34:29 +00:00
[lldb/Reproducers] Also collect ::open and ::fopen
Report files opened trough ::open and ::fopen to the FileCollector.
This commit is contained in:
parent
d31c9e5a46
commit
6c5c4a2a50
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user