Time-Travel Debugging with AI
Record execution with Mozilla’s rr, replay backwards with AI-powered GDB commands.
Usage
# Record
memguard record /tmp/binary
memguard record /tmp/server --args "--port 8080"
# Launch at bug locations
memguard timewarp <scan-id> --launch
memguard timewarp <scan-id> --issue 4
# Inside the debugger
(rr) continue # run to first bug
(rr) mg-ai # AI analyzes current state
(rr) mg-why # AI explains root cause
(rr) mg-suggest # AI suggests next command
(rr) mg-fix # AI generates code fix
(rr) reverse-continue # travel backwards
(rr) reverse-step # step backwards one line
# List recordings
memguard recordings
AI Commands
Command |
Description |
|---|---|
|
Captures frame, source (±20 lines), backtrace, locals, args, known bugs → LLM analysis |
|
Same context, prompts for ROOT CAUSE with specific line numbers |
|
Suggests the single best next GDB command with explanation |
|
Generates exact BEFORE/AFTER code change |
Falls back to GDB process record (with AVX2 disabled) when rr doesn’t support the CPU.