Reputation: 1
I'm trying to run a custom gdb(qnx neutrino -> ntoaarch64-gdb), but for that, I need to set up some environment variables before. I've tried to use the "environment" field, the "envFile" approach, using "terminal.integrated.env.linux", doing a "preLaunchTask" and many other things but I'm not able to set them before the call of the binary. Every try results in gdb being executed without the environment variables. I also have an environment script(.sh) for setting up all the variables.
{
"name": "Launch debug (GDB)",
"type": "cppdbg",
"request": "launch",
"miDebuggerPath": "/path/to/ntoaarch64-gdb",
"program": "/path/to/binary",
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"miDebuggerServerAddress": "(ip):(port)",
"externalConsole": true,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"envFile": "${workspaceFolder}/.env",
"environment": [
{
"name":"ENVVAR",
"value": "/some/path/"
}
]
}
¡QNX environment is not set!
It seems like vscode has two types of terminal, the integrated terminal and the internal terminal. The variables I've been setting sometimes has effect on the integrated one but never in the internal.
Could you help me with this issue? Thanks
I've tried to use the "environment" field, the "envFile" approach, using "terminal.integrated.env.linux", doing a "preLaunchTask" and many other things but I'm not able to set them before the call of the binary in the internal terminal.
Upvotes: 0
Views: 976
Reputation: 1
Another option is to modify the batch file you have mentioned -
Add at the end a call to start VS Code like:
call "C:\....\Microsoft VS Code\Code.exe"
By using call, the execution of the batch file will wait for VS Code to finish before continuing, ensuring that any environment variables set before launching VS Code will be inherited by the VS Code process
Upvotes: 0
Reputation: 1
I was also having this issue and found that you have to set QNX_HOST and QNX_TARGET variables in the environment before launching VSCode.
Upvotes: 0