Index of every page on this site: llms.txt
All skills
jame581 avatar

/gdextension

@426e8ab
by Jan Mesarčjame581/godotprompter979 stars
63
Run it yourself

Use when building native extensions for Godot — godot-cpp (C++) or gdext (Rust), binding classes, building, and GDScript/C# interop

Use this Skill: https://skilld.dev/gh/jame581/godotprompter/gdextension

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesdebugging-native.md

≈579 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Debugging native code

Native (C++/Rust) extensions can't be stepped through with Godot's script debugger — you debug them like any other shared library, with the engine as the host process. Back to GDExtension.

Hot reload

reloadable = true in the .gdextension [configuration] block lets the editor reload the library when you recompile, without restarting the editor. This works in the editor only ("GDExtensions can only be reloaded in an editor build"). It's invaluable while iterating on a class, but turn it off (or simply ship release binaries) for exported games.

Debug vs release libraries

The [libraries] keys carry a build-config feature tag:

[libraries]
windows.debug.x86_64 = "res://bin/gdexample.windows.template_debug.x86_64.dll"
windows.release.x86_64 = "res://bin/gdexample.windows.template_release.x86_64.dll"
  • template_debug binaries enable DEBUG_ENABLED checks — load these in the editor and in debug exports. Like release builds they are optimized and carry no debug symbols unless you build with debug_symbols=yes.
  • template_release binaries are optimized — these must be present in a release export or the native node type won't exist at runtime.

Keep both built so the editor (debug) and your shipped game (release) each load the right one.

Attaching a native debugger

Godot's tutorial doesn't ship a GDB/LLDB walkthrough; the implied path is to attach a native debugger to the running Godot process:

  • Build the extension with debug symbols: scons debug_symbols=yes (add dev_build=yes for an unoptimized build).
  • Launch the editor or game, then attach GDB (Linux), LLDB (macOS), or the Visual Studio / WinDbg debugger (Windows) to the godot / game process.
  • Set breakpoints in your extension's source; trigger the code path from the game.
  • On Windows you can also launch Godot as the debuggee directly from Visual Studio with your .pdb next to the .dll.

Sanitizer builds

For memory and undefined-behaviour bugs, build the extension (and ideally a matching Godot) with sanitizers enabled — e.g. -fsanitize=address / -fsanitize=undefined via your SCons/CMake flags — then run the game under that build to catch use-after-free, out-of-bounds, and UB that a normal debugger would miss.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts29d3 checks · Risk SAFE
  • Gen Agent Trust Hub29d

    No security issues detected. The skill provides standard documentation and build instructions for Godot GDExtensions using official and well-known community resources.

  • Socket29d

    No alerts

  • Snyk29d

    Risk: LOW · No issues

Signed by skilld at 426e8ab. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 6 days ago.

Activeupdated last month

README badge

README badge for jame581/godotprompter/gdextension