Exporting a project on Linux using a C++ GDExtension with debug symbols.

Godot Version

4.4.1

Question

Hi,

I asked this on discord, but did not manage to fix my issue, so I try here.

TLDR

I want to export a project that uses a GDExtension in C++ with debug symbols. How to do that?

Context

A bit more context and what I tried so far:
I am trying to debug a strange crash on my project, it seems to happen sometimes when some C++ code from my GDExtension is called. When this happens, the backtrace shows only the address of the functions. I tried to export the project with debug symbols, but so far, I did not manage to do that. I managed to compile the GDExtension with debug information, but it seems that during the export the debug symbols are striped. The SConstruct file comes from the tutorial on GDExtension, and I compiled the extension with scons target=template_debug dev_build=yes debug_symbols=yes compiledb=true platform=linux. I tried with many variations of this command line, but none worked.
I also tried to build Godot with debug symbols, it worked, now in the backtrace, I have the symbols for the engine, but still no symbols for the GDExtension part. Furthermore, I tried to compile the export template also with debug symbols. But so far, no luck.

You need to have debug symbols for the plugin, do you have those? This is usually defined in the <plugin name>.gdextensionfile

I am not sure I understand fully. I checked, the library produced seems to have the debug symbols, (the file libinstance.linux.template_debug.dev.x86_64.so has debug symbols) and my .gdextension file contains linux.debug.x86_64 = "res://bin/libinstance.linux.template_debug.dev.x86_64.so". It seems to me that somehow, when exporting the project, the debug symbols seem to be stripped.

Debug build has a dubug option that is not obvious when you provide the name.

You can also specify a debug feature tag.

The debug option you mention, is it the “Export With Debug” checked box? If this is the case, I checked and it is on when I export the project. On your screenshot, you seem to be in the “Export PKS/ZIP” case, but I use “Export Project” to be able to run the game outside the editor as so far it is the only way I have found to get the backtrace when a crash occurs.

I read the page on feature tag, but I don’t see how that can help me.