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

Defined in:

libgodot/docs/g_debugging_and_diagnostics/a_radare2_native_debugging.cr

Class Method Summary

Class Method Detail

def self.topic_00_debugging_features : Nil #

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

def self.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.

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

  1. Launch Godot Editor (lapis editor).
  2. The Crystal (radare2) panel appears automatically in the bottom debugger dock.
  3. Set breakpoints in the Godot Script Editor gutter.
  4. 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!