Add a method to auto rename the PDB to avoid blocking debug symbols #1331
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes godotengine/godot#82536 but only for
godot-cpp
andscons
.Other language binds should make similar fixes to the build system to support Hot-Reload and debugging on Windows.
The main problem with
PDB
is that the name of this file is written to theDLL
during the build and you can't just rename it. You can move thePDB
andDLL
to another folder or place them in different folders and specify pdb folder in Visual Studio and everything will work. But you can't change the name of the PDB, so that it can't be used automatically for debugging. Maybe I'm wrong and there is a more elegant solution.To solve this problem, I added a new file
methods.py
, as in Godot, in which themsvc_try_rename_pdb
function is located. This function checks whether renaming can be applied and outputs a new path to the console.The search for an unblocked name takes place in
_get_unblocked_file_name
. In this function, I first find all thePDB
s except the newest one, in order to save it if the project has not been modified, sincescons
will not restore it when deleted. Then I try to delete these files and search for the first unblocked name based on the template{"full/library_name"}_{index}.pdb
.And at the end of
msvc_try_rename_pdb
I explicitly specify the/PDB:
for the linker.This function is registered via
env.AddMethod
ingodotcpp.py
and can be called in a user script, for example in a test script.I also updated
.gdextension
file to4.2
andreloadable = true
, because there is nowhere else to find how to activate hot-reloading.Demo:
pdb_rename.mp4