Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
1 parent
1766e5c
commit 39687ff
Showing
3 changed files
with
18 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include <cstdlib> | ||
#include <iostream> | ||
|
||
int main() { | ||
if (const char *env_p = std::getenv("FOO")) | ||
std::cout << "FOO=" << env_p << '\n'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
The double quotes around "BAR" ensure we don't match the command. | ||
|
||
RUN: %clangxx -std=c++11 %p/Inputs/env.cpp -o %t | ||
RUN: %lldb %t -o 'process launch --environment FOO="BAR"' | FileCheck %s | ||
RUN: %lldb %t -o 'env FOO="BAR"' -o 'process launch' | FileCheck %s | ||
|
||
CHECK: FOO=BAR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters