microsoft / microsoft/vscode-cpptools
Breakpoints with multiple sourceFileMap mapping only works for the first mapping, not the second one
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 1.7k
- Avg merge
- 14h 46m
- Merged PRs (30d)
- 61
Description
Bug type: Debugger
Describe the bug
- OS and Version: Linux Ubunut 18.04
- VS Code Version: 1.60.2
- C/C++ Extension Version: v1.6.0
- Other extensions you installed (and if the issue persists after disabling them): bazel , yes
- A clear and concise description of what the bug is.
I am on a bazel build for a project with multiple workspaces
Therefore I need multiple entries in the sourceFileMap.
The problem is, all breakpoints in sources from the second source file mapping are disabled.
I can step through the code, and the corresponding code is opened in the editor,
but all breakpoints that are not in files from the first source file mapping become disabled/
To Reproduce
Please include a code sample and launch.json configuration.
Steps to reproduce the behavior:
Set a breakpoint in a file from the second mapping, it is ignored
Set a breakpoint in a file from the first mapping, it works
Remove the first mapping, files will not be found, but the breakpoint from the - now first but previously second - breakpoint work
"version": "0.2.0",
"configurations": [
{
"name": "some_bin",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/current_workspace/.bazel/what/ever/some_bin"
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"sourceFileMap": {
// parent bazel workspace == ${workspaceFolder}
"/proc/self/cwd/external/" : "/home/me/project/",
"/proc/self/cwd/" : "/home/me/project/current_workspace/" ,
}
}
Interestingly, when I set stopAtEntry to true, the main function is stopped, (a file from the second mapping) but all breakpoints int this file are grey out
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 issue with the provided launch.json configuration and its two sourceFileMap entries under the C++ debugger. Check breakpoint behavior for files in each mapping, including with stopAtEntry enabled. Done means breakpoints in files from the second mapping remain enabled and are hit like those from the first mapping.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100