diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2018-11-02 22:34:51 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2018-11-02 22:34:51 +0000 |
commit | 50bc1ed290824218a1bb46f70ec731712da610b0 (patch) | |
tree | 1d3e18cd42de622121b266b93322ec7d6e6c4507 /lldb/source/Plugins/ScriptInterpreter/Python | |
parent | d1932dcdd3e3212ad6ad21f586cfa8a44940b8f9 (diff) | |
download | bcm5719-llvm-50bc1ed290824218a1bb46f70ec731712da610b0.tar.gz bcm5719-llvm-50bc1ed290824218a1bb46f70ec731712da610b0.zip |
[FileSystem] Open File instances through the FileSystem.
This patch modifies how we open File instances in LLDB. Rather than
passing a path or FileSpec to the constructor, we now go through the
virtual file system. This is needed in order to make things work with
the VFS in the future.
Differential revision: https://reviews.llvm.org/D54020
llvm-svn: 346049
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python')
-rw-r--r-- | lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp | 3 | ||||
-rw-r--r-- | lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp | 12 |
2 files changed, 10 insertions, 5 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp index 90d8ab97fb7..45ffd0813d4 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp @@ -939,7 +939,8 @@ PythonFile::PythonFile() : PythonObject() {} PythonFile::PythonFile(File &file, const char *mode) { Reset(file, mode); } PythonFile::PythonFile(const char *path, const char *mode) { - lldb_private::File file(path, GetOptionsFromMode(mode)); + lldb_private::File file; + FileSystem::Instance().Open(file, FileSpec(path), GetOptionsFromMode(mode)); Reset(file, mode); } diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp index 7791366e2e1..289607e309a 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp @@ -829,11 +829,15 @@ bool ScriptInterpreterPython::ExecuteOneLine( error_file_sp); } else { input_file_sp.reset(new StreamFile()); - input_file_sp->GetFile().Open(FileSystem::DEV_NULL, - File::eOpenOptionRead); + FileSystem::Instance().Open(input_file_sp->GetFile(), + FileSpec(FileSystem::DEV_NULL), + File::eOpenOptionRead); + output_file_sp.reset(new StreamFile()); - output_file_sp->GetFile().Open(FileSystem::DEV_NULL, - File::eOpenOptionWrite); + FileSystem::Instance().Open(output_file_sp->GetFile(), + FileSpec(FileSystem::DEV_NULL), + File::eOpenOptionWrite); + error_file_sp = output_file_sp; } |