diff options
author | Zachary Turner <zturner@google.com> | 2016-03-22 17:58:09 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2016-03-22 17:58:09 +0000 |
commit | 190fadcdb245707011e31b69a24bd6bba7c93ab5 (patch) | |
tree | 4448dbd3327aa3e5244a448d70ceb1b7a2f45be1 /lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp | |
parent | 6feeb6554e271e308238750078b178ff1e83c15c (diff) | |
download | bcm5719-llvm-190fadcdb245707011e31b69a24bd6bba7c93ab5.tar.gz bcm5719-llvm-190fadcdb245707011e31b69a24bd6bba7c93ab5.zip |
Unicode support on Win32.
Win32 API calls that are Unicode aware require wide character
strings, but LLDB uses UTF8 everywhere. This patch does conversions
wherever necessary when passing strings into and out of Win32 API
calls.
Patch by Cameron
Differential Revision: http://reviews.llvm.org/D17107
Reviewed By: zturner, amccarth
llvm-svn: 264074
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp')
-rw-r--r-- | lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp index 5c7d79e3c6b..10dce60cbbb 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp @@ -19,8 +19,11 @@ #include "lldb/Core/Stream.h" #include "lldb/Host/File.h" +#include "lldb/Host/FileSystem.h" #include "lldb/Interpreter/ScriptInterpreter.h" +#include "llvm/Support/ConvertUTF.h" + #include <stdio.h> #include "llvm/ADT/StringSwitch.h" @@ -1162,9 +1165,7 @@ PythonFile::PythonFile(File &file, const char *mode) PythonFile::PythonFile(const char *path, const char *mode) { - FILE *fp = nullptr; - fp = fopen(path, mode); - lldb_private::File file(fp, true); + lldb_private::File file(path, GetOptionsFromMode(mode)); Reset(file, mode); } |