[Lldb-commits] [PATCH] D76105: [lldb/settings] Reset the inferior environment when target.inherit-env is toggled

Jim Ingham via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Mar 12 16:18:34 PDT 2020


jingham added a comment.

If I'm following the logic correctly, if you run a target with inherit-env off, and then do:

  env VAR_IN_ENVIRONMENT=NOT_THE_ENVIRONMENTS_VALUE

then turn inherit-env on, we will preserve the value you set it to, not the environment value, because you pass in false for can_replace.  That seems right to me.  It would be good to test that case explicitly, however.

But if you have inherit-env on and then run the command above, and then turn inherit-env off, your changed value will just get deleted.  That seems unexpected.  I think you have to compare the values in the else branch and only delete the key if the value is the same as the environment value.  Does that sound right?

If so, then it would be good to test that as well...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76105





More information about the lldb-commits mailing list