-
Notifications
You must be signed in to change notification settings - Fork 2.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] Output exe's debuginfo points to PDB with out+hash.pdb instead of out.pdb #7358
Comments
Thanks for the report! We've had to deal with this before, but can you detail a bit more about how the |
So the information inside the .exe is
And the symbol information:
The debugging tools usually have a file finding algorithm that trim the path to look for the file. The problem is that the file it's looking for is heap_oob_simple-82ee03cff5089374.pdb (in the deps/ folder but doesn't mater as the algorithms will get rid of the paths) that doesn't match the name of the file generated in the output directory. The problems appear when they are distributed. |
Ok thanks for the information! Would you be able to compile Cargo locally and give a patch a spin? I think the change would go around here and would look like this line except use |
Thanks so much Alex! I will try as soon as I have a few cycles and report back. |
Just tried it and it seems to get rid of the hash indeed:
I'm submitting a PR but let me know if there is anything else that I should check before we can merge this. |
Great! Thanks for testing this out, I'll go check out the PR and we can take it from there. |
Removing hash from output files when using MSVC This is the fix for #7358 suggested by @alexcrichton . Tested and working. I see a few tests failling but seem unrelated. I'll investigate them tomorrow.
Thanks so much for your help Alex! Closing the issue. |
Describe the problem you are trying to solve
Whenever
cargo build
is run, it creates the filesname+hash.exe
andname+hash.pdb
in the directorytarget/xxx/deps/
. Then when the files are copied totarget/xxx/
, the.exe
still references to the.pdb
in the deps directory which also includes the hash in the name.Then there are problems if the
.pdb
is distributed along the.exe
. When someone tries to debug the program without the deps/ folder, the debugger doesn't find the symbols. I understand this is only a one-time issue per person (once they educate themselves on this behaviour) but it's not a good default.Describe the solution you'd like
I tried looking up if there were previous discussions about it but couldn't find anything.
The only solution I could think of was creating the exe and pdb with the same name that should go into target/ and then copy them to deps/. I believe it's not a common practice to debug the files in deps/ so it shouldn't be an issue if the pdb link in that folder mismatches the name.
Notes
The text was updated successfully, but these errors were encountered: