[Lldb-commits] [PATCH] D107869: [LLDB][GUI] Add Process Launch form

Jim Ingham via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 11 11:52:17 PDT 2021


jingham added a comment.

In D107869#2939922 <https://reviews.llvm.org/D107869#2939922>, @OmarEmaraDev wrote:

> One thing to note as well is that the target environment seem to include many environment variables like PATH and HOME, I don't think those should be included.

If I am debugging a program on my local machine then I do want the program to start up with reasonable values for PATH and HOME, DISPLAY and suchlike or it won't run correctly.  Since people don't tend to have a lot of "debugger specific environment" variables set, it's just a fairly vanilla command-line tool in that regard, the debugger's environment is a fine thing to use to prime the inferior.  Note, if there are certain environment variables that you don't want to pass from the debugger to the inferior, use the setting target.unset-env-vars.

Of course, if you are debugging remotely to a device or to another machine, you probably don't want to share many (or any) env-vars with the inferior.  In that use-case, you set target.inherit-env to 0 and fill in all the necessary ones with target.env-vars.

But I think the most common use-case is local debugging, and lldb is usually run with a fairly reasonable environment, so having target.inherit-env be true by default is the right choice.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107869/new/

https://reviews.llvm.org/D107869



More information about the lldb-commits mailing list