Ok, my problem is that I'm not able to create the debug symbols.
I found this tutorial
but it's quite old and if I follow it it does not work.
I'm not an expert on scons and I just modified the scons file in the godot-cpp/test folder, but I noticed that even if I compile with debug_templat that project it does not create the *.pdb files.
So my question is, what option should I enable to create the *.pdb files?
my SConstruct file looke like this:
#!/usr/bin/env python
import os
import sys
env = SConscript("godot-cpp/SConstruct")
# For the reference:
# - CCFLAGS are compilation flags shared between C and C++
# - CFLAGS are for C-specific compilation flags
# - CXXFLAGS are for C++-specific compilation flags
# - CPPFLAGS are for pre-processor flags
# - CPPDEFINES are for pre-processor defines
# - LINKFLAGS are for linking flags
# tweak this if you want to use different folders, or more folders, to store your source code in.
env.Append(CPPPATH=["src/"])
#env.Append(CPPPATH=["src/tbs/"])
# Local dependency paths, adapt them to your setup
godot_headers_path = "godot-cpp/godot-headers/"
cpp_bindings_path = "godot-cpp/"
cpp_library = "libgodot-cpp"
# only support 64 at this time..
bits = 64
sources = Glob("src/*.cpp") + Glob("src/tbs/*.cpp") + Glob("src/common/*.cpp") + Glob("src/common/players/*.cpp") + Glob("src/tbs/players/*.cpp") + Glob("src/tbs/game_logic/*.cpp") + Glob("src/tbs/unit_avatar_actions/*.cpp")
if env["target"] == "debug":
env.Append(CPPDEFINES=["DEBUG_ENABLED", "DEBUG_METHODS_ENABLED"])
if env["platform"] == "macos":
library = env.SharedLibrary(
"project/bin/hea.{}.{}.framework/hea.{}.{}".format(
env["platform"], env["target"], env["platform"], env["target"]
),
source=sources,
)
else:
library = env.SharedLibrary(
"project/bin/hea{}{}".format(env["suffix"], env["SHLIBSUFFIX"]),
source=sources,
)
Default(library)
Everything works and compiles but without the debug symbols.
Yes. You may also need to tell your debugger where to find the godot pdb file. e.g. for my gd_extension testing, I copied the godot pdb file to the same directory as my extension dll.
Can someone provide step by step instruction please?
Do i need to compile both godot and extension with dev_build=yes?
How do I set pdb files both for godot and extension in studio?
do I need to add these lines?
if env["target"] == "debug":
env.Append(CPPDEFINES=["DEBUG_ENABLED", "DEBUG_METHODS_ENABLED"])
I've managed to get debugging symbols in engine code by compiling it with dev_build=yes.
But cant get debugging working for extension even compiling it with dev_build=yes. Does anyone know how to make visual studio look for dll debugging symbols?
You may want to ask on the Godot chat in the Godot community tab on the main Godot site, as the Godot developers are more frequent there and they’d likely have more information on GDExtensions.
Yan, did you see my previous comment in this thread? Repeated here: "You may also need to tell your debugger where to find the godot pdb file. e.g. for my gd_extension testing, I copied the godot pdb file to the same directory as my extension dll.'
Does anyone know how to make visual studio look for dll debugging symbols?
Copying the godot pdb to your bin directory should work, but you have to do it for every project you want to debug. If you want a more general solution:
In Visual Studio 2019, select menu "Tools >> Options"
In the Options dialog, on the left-hand column, select "Debugging >> Symbols"
On the top right-hand side of the options dialog, select the "+" symbol to add a search directory. Enter the path to the 'bin' directory where you built the Godot game engine, (on my system, it's "D:\Godot\godot\bin", but it will be different on each system) (Double check that the pdb file exists in this directory. If not, rebuild Godot with symbols enabled)
I've figured out how to debug gdetension with Visual Studio (or Rider). 1. First you need to compile your engine and your extension with dev_build=yes 2. You'll get dll with "dev" name in it. Provide path to it i your extension file. 3. Create an empty Visual Studio solution. And an empty NMake project. 4. Setup studio to build your code for you with debug button. Type in NMake tab of project properties, in the "build command line" the command: scons dev_build=yes. This way studio will compile project for you. 5. In the Dedugger tab set launch command to "$your_path\godot.windows.editor.dev.x86_64.exe" 6. Set command line arguments with "--path" command that will tell engine to start game immediately. like this: --path "$(SolutionDir)../" 6.a. If you'll provide in argument path to your godot.project engine will start in editor mode. Thats fine if you want to debug editor, but if you'll start game from the editor the c++ debugger wont attach to it. For debugging editor I've created another NMake configuration for it. 6.b. Probably a studio bug, but in order to intell issence to see godot-cpp code it wants its path to be included in "additional include" field of c++ configuration tab which is missing in NMake configuration. you might want to switch to c++ configuration, add additional includes path that lead to godot-cpp source, and then switch back to NMake. Or you can manually edit project file in text editor by adding there something like (in my case):
7. That pretty much it. you are ready to go. you can also add godot engine project to your solution if you want. this way you don't need to copy pdb anywhere (it did not work for me anyway)
I am finishing work on sln generation improvement for the godot itself. https://github.com/godotengine/godot/pull/103405
Same approach can be used for the GDExtensions to use Rider outside Windows.
Loading...
Something went wrong while trying to load the full version of this site. Try hard-refreshing this page to fix the error.