Debugging¶
This guide focuses on practical triage for wrapper/runtime issues.
Fast Triage Checklist¶
- confirm runtime in a real tty/console session
- verify requested versions and config are valid
- inspect event batch bytes for framing errors
- inspect drawlist validation errors before present
- collect metrics and (optionally) debug trace snapshots
Common Symptoms¶
No output or garbled output¶
- verify terminal supports ANSI sequences
- confirm
engine_present()return code isZR_OK - verify wrapper drawlist is valid and non-empty
Input appears missing¶
- verify poll loop cadence (
engine_poll_events) is running - check event buffer capacity/truncation flag
- validate wrapper parser handles unknown event types by size skipping
Resize not reflected¶
- ensure wrapper handles
ZR_EV_RESIZE - ensure redraw path rebuilds drawlist for new viewport
Wrong key/mouse interpretation¶
- log raw event batch records (
type,size, payload fields) - compare with public event structs in
zr_event.h
Debug Trace API Workflow¶
- enable trace (
engine_debug_enable) - run scenario
- query headers (
engine_debug_query) - fetch payloads (
engine_debug_get_payload) - inspect aggregate stats (
engine_debug_get_stats) - optional export for offline analysis (
engine_debug_export)
Useful Runtime Signals¶
- metrics: bytes emitted, damage counts, event drop counts
- caps: negotiated terminal feature set
- event truncation flag: sustained pressure on wrapper event buffer