Open Ambiophonique opened 2 hours ago
Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.95.3. Please try upgrading to the latest version and checking whether this issue remains.
Happy Coding!
I tried with the latest version and the bug is still here
Does this issue occur when all extensions are disabled?: Yes
VScode gets rid of environment variables when I debug a C++ programs which forks.
Here is an example with a 2 files project :
Here is my launch.json
hello1.cpp
hello2.cpp
to build hello1.cpp and hello2.cpp :
What is astonishing is when I debug hello1 I can see my FOO environment variable is correctly defined :
Then I switch the follow-fork-mode to child :
-exec set follow-fork-mode child
But when I fork in hello2, gdb can't find the FOO environment variable anymore :
but oddly enough, the program hello2 manages to print the environment variable correctly :
myVarEnv = foo
Moreover, if I debug this program with gdb, gdb can find the FOO environment variable perfectly in both hello1 and hello2 :
Since, VScode just uses gdb, that means VScode should be able to find the FOO environment normally, right ?