microsoft / microsoft/vscode-cpptools
Not able to setup environment variables before the debugger is launched
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 1.7k
- Avg merge
- 14h 46m
- Merged PRs (30d)
- 61
Description
Environment
- OS and version: Kubuntu / linux 5.15.0-52-generic
- VS Code: 1.75.0
- C/C++ extension: 1.14.4
- OS and version of remote machine (if applicable):
- GDB / LLDB version:
Bug Summary and Steps to Reproduce
Bug Summary:
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 currently have an environment script(.sh) for setting up all the variables.
Steps to reproduce:
- I'm trying to run the launch gdb that needs some environment variables to be set.
- Try to add the envFile, environment field or any other approach.
- Launch the debugger
- See that the gdb debugger fails because variables are not set.
Could you help me with this issue?
Thanks
Debugger Configurations
{
"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/"
}
]
}
Debugger Logs
¡QNX environment is not set!
Other Extensions
I'm using the extensions for C/C++.
Additional Information
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the launch configuration with miDebuggerPath set to ntoaarch64-gdb and the environment and envFile fields populated. Check the debugger launch behavior using the supplied QNX environment script and the “QNX environment is not set!” log. Done means the required variables are available before the custom GDB process starts, or the issue is documented as unsupported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 32/100