microsoft / microsoft/vscode-cpptools

VS Code 'terminal.integrated.env.*' settings not taken into account for 'miDebuggerPath'

Open
#11,857 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

debugger help wanted Language Service
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Environment
  • OS and version: Ubuntu 20.04.6 LTS (Focal Fossa)
  • VS Code: 1.85.1
  • C/C++ extension: 1.18.5
Bug Summary and Steps to Reproduce

Bug Summary:

The terminal.integrated.env.* VS Code settings are not taken into account for the miDebuggerPath option default value.

This creates some discrepancy between the GDB program that can be run from a VS Code Terminal for this workspace and the one actually used by the extension.

My suggestion would be to take into account the terminal.integrated.env.* VS Code settings while computing the default GDB program, when miDebuggerPath is not explicitly configured in the launch.json file.

Steps to reproduce:

  1. Open the reproducer
  2. Modify terminal.integrated.env.linux setting to set the PATH environment variable to custom GDB installation
  3. Launch the C/C++ debugger (C++ Launch in the Debug Panel)
  4. Problem: the GDB used by the extension (with the version displayed in the Debug Console) will not match the one available from a VS Code Terminal
Debugger Configurations
All the needed configuration files are in the `.vscode` folder of the following archive:

[cpp_project.zip](https://github.com/microsoft/vscode-cpptools/files/13905675/cpp_project.zip)
Debugger Logs
No logs
Other Extensions

No response

Additional Information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reproducer's .vscode configuration and launch.json, then run the C++ Launch configuration and compare the GDB version in the Debug Console with the one available from the VS Code Terminal. Done means terminal.integrated.env.linux, including a custom PATH, affects the default miDebuggerPath when launch.json does not set it explicitly.

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
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.