-
Notifications
You must be signed in to change notification settings - Fork 29.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows Debugger breaks on lowercase filename #12922
Comments
Please file this issue aginast the vscode cpp extension here https://github.com/Microsoft/vscode-cpptools |
I don't think that this is an issue with the C++ debugger. It seems that the vscode shell isn't correctly understanding that Windows file names are not case sensitive, and will open duplicate files on Windows if the paths to the files differ only in casing. This is similar to, for example, not understanding that two different relative file paths point to the same file. The editors should do proper checks to ensure that they only open one copy of the file. |
We use URI as an ID for files internally and it seems that the workbench handles these URIs as case sensitive. Not sure if we want / can change that. @weinand let me know what you think |
Ideally, this problem would not occur if all involved VS Code components would only use the file path with the real character case from disk (so that no differently cased paths get introduced). However, in real life it is always possible that a path with a different case gets introduced by a component that VS Code cannot control (e.g. a path in an executable created by a compiler/linker). The correct place to address this is when searching for a file in a workspace. So when a debug adapter returns a file path, the VS Code debug UI would not use the path as an URI that is expected to exist under the exact URI but instead it initiates a path search that takes the case sensitivity of the platform into account. Until this has been fixed in VS Code, I suggest that debug adapters try to fix paths on their end. So if a path returned by a runtime/debugger doesn't match the casing of a file on disk, the debug adapter would correct that path before returning it to VS Code. |
@martincohen thanks for reporting this issue. Can you please file a new seperate issue so this finding does not get lost, as the current issue is mostly about the debugger, and your issue is a general vscode issue (in the end they might have the same root cause but I would like to have then seperate). |
@delmyers I suggest you ask over at https://github.com/Microsoft/vscode-cpptools/issues how it is possible that paths with wrong casing are entering the system in VS Code. You can CC me so that I can learn more about why this problem happens only with the C++ debugger (I have not heard this from any other debugger so far). |
@bpasero I did, they will try to normalize the paths, but this is a bigger issue. It is happening all the time on Windows, it's not a problem specific to |
Great to hear that they try to normalize 👍 |
@bpasero As I said and posted in the last image in previous comment, it's not only problem of the debugger, but entire Windows. In the image above you can clearly see that even VS Code command line dosen't normalize. So any toolchain can do this no matter what contract you try to force upon Windows users. |
I am not sure how i can acknowledge that more than pointing you to an existing bug? Did you actually look at it? |
@bpasero I've seen the #12448 (I haven't seen you mention it in this thread, but I know and read about it), though I got an impression that we're still debating whether it's Sorry, I've been filing bugs left and right, and answered the same questions in multiple threads on both |
Steps to Reproduce:
The editor will open up source.cpp alongside Source.cpp. The arrow pointing to the current line is in source.cpp, the breakpoints are in Source.cpp. It's pretty confusing. Both files can have their own sets of breakpoints now.
The text was updated successfully, but these errors were encountered: