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/Target/ProcessLaunchInfo.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/Target/ProcessLaunchInfo.cpp')
-rw-r--r-- | lldb/source/Target/ProcessLaunchInfo.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lldb/source/Target/ProcessLaunchInfo.cpp b/lldb/source/Target/ProcessLaunchInfo.cpp index c9c53e9d2d7..4e4db8742e5 100644 --- a/lldb/source/Target/ProcessLaunchInfo.cpp +++ b/lldb/source/Target/ProcessLaunchInfo.cpp @@ -13,14 +13,21 @@ // Other libraries and framework includes // Project includes -#include "lldb/Host/Config.h" #include "lldb/Core/Debugger.h" #include "lldb/Core/Log.h" +#include "lldb/Host/Config.h" #include "lldb/Host/FileSystem.h" -#include "lldb/Target/ProcessLaunchInfo.h" +#include "lldb/Host/HostInfo.h" #include "lldb/Target/FileAction.h" +#include "lldb/Target/ProcessLaunchInfo.h" #include "lldb/Target/Target.h" +#include "llvm/Support/ConvertUTF.h" + +#if !defined(_WIN32) +#include <limits.h> +#endif + using namespace lldb; using namespace lldb_private; @@ -449,8 +456,8 @@ ProcessLaunchInfo::ConvertArgumentsForLaunchingInShell (Error &error, if (cwd && cwd[0]) new_path += cwd; } - const char *curr_path = getenv("PATH"); - if (curr_path) + std::string curr_path; + if (HostInfo::GetEnvironmentVar("PATH", curr_path)) { if (new_path.size() > empty_path_len) new_path += ':'; |