diff options
| author | Pavel Labath <labath@google.com> | 2018-01-10 12:25:48 +0000 |
|---|---|---|
| committer | Pavel Labath <labath@google.com> | 2018-01-10 12:25:48 +0000 |
| commit | 3ff377a9275adf1ffae29ac09afcd3e86b9e0c94 (patch) | |
| tree | fa6205a9c530bbcb3dfdd45a71f20ab502ab5512 | |
| parent | a330a407c4fd309d7da2abfb7dad28e488bdd014 (diff) | |
| download | llvm-3ff377a9275adf1ffae29ac09afcd3e86b9e0c94.zip llvm-3ff377a9275adf1ffae29ac09afcd3e86b9e0c94.tar.gz llvm-3ff377a9275adf1ffae29ac09afcd3e86b9e0c94.tar.bz2 | |
Fix windows and freebsd builds for r322174 (Environment)
llvm-svn: 322176
| -rw-r--r-- | lldb/source/Host/windows/ProcessLauncherWindows.cpp | 12 | ||||
| -rw-r--r-- | lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp | 5 |
2 files changed, 8 insertions, 9 deletions
diff --git a/lldb/source/Host/windows/ProcessLauncherWindows.cpp b/lldb/source/Host/windows/ProcessLauncherWindows.cpp index 5608974..d3b2c86 100644 --- a/lldb/source/Host/windows/ProcessLauncherWindows.cpp +++ b/lldb/source/Host/windows/ProcessLauncherWindows.cpp @@ -21,14 +21,15 @@ using namespace lldb; using namespace lldb_private; namespace { -void CreateEnvironmentBuffer(const Args &env, std::vector<char> &buffer) { - if (env.GetArgumentCount() == 0) +void CreateEnvironmentBuffer(const Environment &env, + std::vector<char> &buffer) { + if (env.size() == 0) return; // Environment buffer is a null terminated list of null terminated strings - for (auto &entry : env.entries()) { + for (const auto &KV : env) { std::wstring warg; - if (llvm::ConvertUTF8toWide(entry.ref, warg)) { + if (llvm::ConvertUTF8toWide(Environment::compose(KV), warg)) { buffer.insert(buffer.end(), (char *)warg.c_str(), (char *)(warg.c_str() + warg.size() + 1)); } @@ -75,9 +76,8 @@ ProcessLauncherWindows::LaunchProcess(const ProcessLaunchInfo &launch_info, if (launch_info.GetFlags().Test(eLaunchFlagDebug)) flags |= DEBUG_ONLY_THIS_PROCESS; - auto &env = const_cast<Args &>(launch_info.GetEnvironmentEntries()); LPVOID env_block = nullptr; - ::CreateEnvironmentBuffer(env, environment); + ::CreateEnvironmentBuffer(launch_info.GetEnvironment(), environment); if (!environment.empty()) env_block = environment.data(); diff --git a/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp b/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp index 7a937db..cc039c2 100644 --- a/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp +++ b/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp @@ -407,9 +407,8 @@ Status ProcessFreeBSD::DoLaunch(Module *module, m_monitor = new ProcessMonitor( this, module, launch_info.GetArguments().GetConstArgumentVector(), - launch_info.GetEnvironmentEntries().GetConstArgumentVector(), - stdin_file_spec, stdout_file_spec, stderr_file_spec, working_dir, - launch_info, error); + launch_info.GetEnvironment().getEnvp(), stdin_file_spec, stdout_file_spec, + stderr_file_spec, working_dir, launch_info, error); m_module = module; |
