module
Lapis::Docs::G_DEBUGGING_AND_DIAGNOSTICS::A_RADARE2_NATIVE_DEBUGGING
Overview
Native radare2 Debugging, Decompilation & Gutter Breakpoints
Comprehensive guide to debugging Crystal game code running inside Godot using the radare2 native debugger and cradare2 engine, setting line-level breakpoints, decompiling functions on the fly, and coordinating multiplayer sessions in lockstep.
Executive Summary & Key Topics
| Topic | Method / Anchor | Description |
|---|---|---|
| Debugger & Decompiler Capabilities | .topic_00_debugging_features |
In-editor gutter breakpoints, native pseudo-C decompilation (pdc), disassembly (pdf), and PDB/DWARF symbol resolution. |
| Launching Game or Editor under radare2 | .topic_01_launching_under_radare2 |
Running lapis run -d or lapis editor -d from command line or IDE. |
Related Guides & Source References
- Debugger Driver:
src/libgodot/debugger/radare_driver.cr - Decompiler:
src/libgodot/debugger/decompiler.cr - Crash Forensics:
src/libgodot/debugger/plugin_forensics.cr - Live Specs:
spec/radare_driver_spec.cr
Defined in:
libgodot/docs/g_debugging_and_diagnostics/a_radare2_native_debugging.crClass Method Summary
-
.topic_00_debugging_features : Nil
Debugger & Decompiler Capabilities: In-editor gutter breakpoints, native pseudo-C decompilation (pdc), disassembly (pdf), and PDB/DWARF symbol resolution.
-
.topic_01_launching_under_radare2 : Nil
Launching Game or Editor under radare2: Running lapis run -d or lapis editor -d from command line or IDE.
Class Method Detail
Debugger & Decompiler Capabilities: In-editor gutter breakpoints, native pseudo-C decompilation (pdc), disassembly (pdf), and PDB/DWARF symbol resolution.
Key Topics & Information
- Set gutter breakpoints directly inside .cr files in Godot Editor or IDEs
- Zero-dependency native pseudo-C decompilation (pdc) and side-by-side assembly (pdca)
- Full symbol resolution for Crystal functions, Godot C-API, and C++ loader bridge
- Multiplayer cooperative lockstep pause/resume across Server and Client instances
- Automated dead-pointer detection via Godot ObjectDB 64-bit instance ID tracking
Launching Game or Editor under radare2: Running lapis run -d or lapis editor -d from command line or IDE.
Method 1: Command Line (Lapis CLI)
# Run standalone game under radare2:
lapis run --debug
# Launch Godot Editor under radare2:
lapis editor --debug
# Decompile functions or classes into pseudo-C:
lapis decompile bin/game.dll "Player#_physics_process"
Method 2: Godot In-Editor Debugger
- Launch Godot Editor (
lapis editor). - The Crystal (radare2) panel appears automatically in the bottom debugger dock.
- Set breakpoints in the Godot Script Editor gutter.
- Press F5 to run the project. When a breakpoint is hit, the 3-pane debugger interface displays call stacks, registers, and real-time decompiled pseudo-C!