aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectProcess.cpp
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-05-13 19:17:48 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2019-05-13 19:17:48 +0000
commitae54fc9f0422ed541e4f3197fb2a3538af7f1ab9 (patch)
tree15b93292f5778394b6805dbaa540b596d666e170 /lldb/source/Commands/CommandObjectProcess.cpp
parent6c86f7d75e12cdbe85f4395c261875be635df5de (diff)
downloadllvm-ae54fc9f0422ed541e4f3197fb2a3538af7f1ab9.zip
llvm-ae54fc9f0422ed541e4f3197fb2a3538af7f1ab9.tar.gz
llvm-ae54fc9f0422ed541e4f3197fb2a3538af7f1ab9.tar.bz2
Merge target and launch info environments
Before this change we were overriding the launch info environment with the target environment. This meant that the environment variables passed to `process launch --environment <>` were lost. Instead of replacing the environment, we should merge them. Differential revision: https://reviews.llvm.org/D61864 llvm-svn: 360612
Diffstat (limited to 'lldb/source/Commands/CommandObjectProcess.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectProcess.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp
index 1cc0b0b..b20a2d5 100644
--- a/lldb/source/Commands/CommandObjectProcess.cpp
+++ b/lldb/source/Commands/CommandObjectProcess.cpp
@@ -193,7 +193,10 @@ protected:
if (target->GetDisableSTDIO())
m_options.launch_info.GetFlags().Set(eLaunchFlagDisableSTDIO);
- m_options.launch_info.GetEnvironment() = target->GetEnvironment();
+ // Merge the launch info environment with the target environment.
+ Environment target_env = target->GetEnvironment();
+ m_options.launch_info.GetEnvironment().insert(target_env.begin(),
+ target_env.end());
if (!target_settings_argv0.empty()) {
m_options.launch_info.GetArguments().AppendArgument(