[Lldb-commits] [PATCH] D74636: [lldb-vscode] Add inheritEnvironment option
Pavel Labath via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Fri Mar 20 03:46:02 PDT 2020
labath added inline comments.
================
Comment at: lldb/test/API/tools/lldb-vscode/environmentVariables/main.cpp:8
+
+int main(int argc, char const *argv[], char const *envp[]) {
+ char **env_var_pointer = environ;
----------------
I guess you don't need the `envp` argument if you're going to use `environ`. (I'm not sure which one is more portable -- I don't think either of them is fully standardized)
================
Comment at: lldb/tools/lldb-vscode/lldb-vscode.cpp:1382-1383
+ std::ostringstream oss;
+ oss << "settings set target.inherit-env "
+ << (launchWithDebuggerEnvironment ? "true" : "false");
+ g_vsc.RunLLDBCommands(llvm::StringRef(), {oss.str()});
----------------
Is there a way to avoid fiddling with this setting? E.g. if we get the initial environment via `target.GetPlatform().GetEnvironment()` (or not, depending on the value of `launchWithDebuggerEnvironment`), then I'd expect we should be able to get the right behavior regardless of the value that the user has set for `target.inherit-env`, and without overwriting the user-set value.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D74636/new/
https://reviews.llvm.org/D74636
More information about the lldb-commits
mailing list