Author: labath Date: Wed Jan 10 04:25:48 2018 New Revision: 322176 URL: http://llvm.org/viewvc/llvm-project?rev=322176&view=rev Log: Fix windows and freebsd builds for r322174 (Environment)
Modified: lldb/trunk/source/Host/windows/ProcessLauncherWindows.cpp lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp Modified: lldb/trunk/source/Host/windows/ProcessLauncherWindows.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/windows/ProcessLauncherWindows.cpp?rev=322176&r1=322175&r2=322176&view=diff ============================================================================== --- lldb/trunk/source/Host/windows/ProcessLauncherWindows.cpp (original) +++ lldb/trunk/source/Host/windows/ProcessLauncherWindows.cpp Wed Jan 10 04:25:48 2018 @@ -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(co 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(); Modified: lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp?rev=322176&r1=322175&r2=322176&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp (original) +++ lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp Wed Jan 10 04:25:48 2018 @@ -407,9 +407,8 @@ Status ProcessFreeBSD::DoLaunch(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; _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits