[VSCode] Implement UseForBreakpoints for sourceFileMap with the C++ extension
See original GitHub issueThis is kind of two issues… The first is that when using GDB and setting a breakpoint on a file which has the same name as another file it will set the breakpoint on the wrong one. For example: a/file.cpp b/file.cpp set breakpoint on b/file.cpp and it gets set on a/file.cpp (2854) <-1272-break-insert -f file.cpp:123 This still seems like the open issue https://github.com/Microsoft/MIEngine/issues/147
That issue mentions that a sourceFileMap might fix this and looking at MapCurrentSrcToCompileTimeSrc it seems like it should but you need to enable the undocumented “useForBreakpoints” flag.
Looking at the format defined in https://github.com/Microsoft/MIEngine/blob/master/src/MIDebugPackage/OpenFolderSchema.json
It seems like I should just need to add:
"sourceFileMap": { "/compiler/path": { "editorPath": "/editor/path", "useForBreakpoints": true } },
But I now get the error:
ERROR: Configuration for 'sourceFileMap' has a format error and will be ignored. Exception: Error reading string. Unexpected token: StartObject. Path '/compiler/path'.
Looking at SetCommonDebugSettings it looks like it’s only parsing it as a string, not an object.
Is there any other fix/workaround to get debugging working with the same file names with GDB?
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (1 by maintainers)
Top GitHub Comments
@RYDB3RG The reason that was done is to support paths that don’t exactly match. The work needs to be done in
OpenDebugAD7
to support theuseForBreakpoints
or forward the entire json blob toMIEngine
(where you referenced the code above) so that the json parser there handles the setting.@pieandcakes I was wondering if removing this line would help: https://github.com/microsoft/MIEngine/blob/3e998f58181d99315c85498cac483ee800e38ac6/src/MIDebugEngine/Engine.Impl/Breakpoints.cs#L117
I think its the reason that a fully qualified name becomes its basename and thus leads to multiple breakpoints