microsoft / microsoft/MIEngine
'sourceFileMap' does not work if there are duplicate keys/values
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 859
- Forks
- 233
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 3
Description
We will incorrectly bind the breakpoint if there are duplicate editorPath keys since it will always pick up the first one if it is not unique.
Example launch.json:
"sourceFileMap": {
"/project/Bcgir_task_build.latest_pass": {
"editorPath": "/project/test",
"useForBreakpoints": false
},
"/project/.Bcgir_task_build.latest_pass.sbsyncmaster": {
"editorPath": "/project/test",
"useForBreakpoints": false
},
"/project/.Bcgir_task_build.latest_pass.sbsyncmaster.inprogress": {
"editorPath": "/project/test",
"useForBreakpoints": false
}
},
Example Setting Breakpoint:
<-- C (setBreakpoints-4): {"command":"setBreakpoints","arguments":{"source":{"name":"tGenAndKill.cpp","path":"/project/test/matlab/src/cgir_support/dom_core/analysis/livenessAnalysis/pkgtest/tGenAndKill.cpp"},"lines":[5],"breakpoints":[{"line":5}],"sourceModified":false},"type":"request","seq":4}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (6613) <-1013-break-insert -f /project/Bcgir_task_build.latest_pass/matlab/src/cgir_support/dom_core/analysis/livenessAnalysis/pkgtest/tGenAndKill.cpp:5\n"},"seq":504}
1: (6613) <-1013-break-insert -f /project/Bcgir_task_build.latest_pass/matlab/src/cgir_support/dom_core/analysis/livenessAnalysis/pkgtest/tGenAndKill.cpp:5
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (6649) ->&\"No source file named /project/Bcgir_task_build.latest_pass/matlab/src/cgir_support/dom_core/analysis/livenessAnalysis/pkgtest/tGenAndKill.cpp.\\n\"\n"},"seq":506}
1: (6649) ->&"No source file named /project/Bcgir_task_build.latest_pass/matlab/src/cgir_support/dom_core/analysis/livenessAnalysis/pkgtest/tGenAndKill.cpp.\n"
Related: https://github.com/microsoft/vscode-cpptools/issues/6381
Fix:
Validate that compileTimePath and sourcePath are unique.
https://github.com/microsoft/MIEngine/blob/728f403c563c2c50c46542e9b44271a7f8d5895b/src/MICore/LaunchOptions.cs#L372-L415
Contributor guide
No contributing guide indexed for this repository
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 in src/MICore/LaunchOptions.cs around lines 372-415, where sourceFileMap entries are processed. Trace how compileTimePath and sourcePath are handled for duplicate values, then validate that both are unique and confirm the breakpoint mapping no longer selects an ambiguous entry.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100