OS: macOS Sierra 10.12.6
VSCode version: 1.17.0-insiders
20dfcb6467a2f1aee0f122001a4e69cb3a134dd9
2017-10-03T01:21:33.052Z
C/C++ extension version: 0.13.0
When debugging a C++ project where the Makefile lives in a separate directory (like e.g. a native node module), the URIs returned by the C++ debugger contain /build/../ and do not match what VS Code expects.
This should be easily reproducible by debugging any native node module. Please let me know if you have trouble coming up with a project setup where this reproduces.
Observe: breakpoints are not rendered and the same file is opened twice in VSCode, once with the normalized URI, and once with the URI returned by the debug adapter. This can be confirmed by copying the file path.
Furthermore, once I edit in the newly (non-normalized URI) file, the language service becomes very confused (presumably it merges change events from both buffers).

fyi @isidorn @bpasero
@pieandcakes may know more, but from what he tells me, the debugger just takes the value stored in the pdb and sends it to VS Code and he wants VS Code to normalize the path (see https://github.com/Microsoft/vscode-cpptools/issues/1095 ), because that same code is used by other products like Visual Studio which normalize the path, and he doesn't have time to spend fixing this issue because he's working on higher priority VS debugger stuff. We normalize our paths in the language service, so I might be able to send @pieandcakes the code to use in the debugger.
@sean-mcmanus This is on Mac so it is neither pdb debugging and would not be part of the same issue you are running into.
@alexandrudima This seems like it is using relative paths during build and that is what we get from the symbols. We return this directly to the VSCode which looks like it doesn't make any attempt to normalize it. If you add a sourceFileMap for \build\.. to map it to the actual directory where it is expected, it should temporarily offer you a workaround. I will see if this can be a quick fix for a future release.
@isidorn Can we normalize URIs on our side then?
IMHO this issue is terribly annoying for debugging native node modules (and perhaps other C++) on OSX.
@weinand introduced some file normalization on the vscode side this milestone, he can comment more.
@isidorn I'm not aware that I did any "file path normalization". I only tried to prevent that "file path normalization" is performed on non-paths (e.g. URIs).
@pieandcakes a debug adapter should return an absolute and normalized path in Source objects.
@weinand exactly. I was not being precise enough.
@alexandrudima I will see if I can expand the change I made for Windows gdb and test it on OSX.
@alexandrudima This should now be part of 0.14.1
Thank you! :heart: