microsoft / microsoft/vscode-cmake-tools

vscode-cmake-tools default debugger config `cmake.debugConfig` unable to adapt GDB and lldb simultaneously

Open
#3,621 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement Feature: debug/launch
Dominant language
TypeScript
Stars
1.7k
Forks
546
Avg merge
2d 16h
Merged PRs (30d)
32

Description

vscode-cmake-tools has its own debugging configuration in settings.json. When we click the debugging button in the status bar, if we configure our own configuration in settings.json, it will enable our own configuration instead of the default configuration.

Meanwhile, VSCode will determine which debugger to start based on the currently selected compiler. GCC will start GDB, while Clang will start lldb mi or lldb.

Sometimes it may be necessary to configure different startup commands for different debuggers, which can result in the command of another debugger in the configuration not being executed correctly after switching the debuggers, and thus unable to start the debuggers.

for example, cmake.debugConfig in settings.json for lldb:

{
	"cmake.debugConfig": {
		"setupCommands": [
			{
				"text": "settings set target.disable-aslr false",
			}
		],
	},
}

Due to the inability to configure for different debuggers, switching the debugger to GDB, click the debugging button in the status bar:
image

vscode report:

image

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 by tracing how cmake.debugConfig in settings.json is consumed when the status-bar debugging button launches VS Code's selected debugger. Compare the GDB and lldb startup paths and determine how debugger-specific commands should be selected. Done means switching between GCC/GDB and Clang/lldb starts each debugger without executing incompatible setup commands.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, typescript, vscode
Domain
developer-experience, 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.