Skip to content

[debugger] Add native ratatui TUI debugger PoC for GSOC 2026#4931

Open
alaotach wants to merge 1 commit intorust-lang:masterfrom
alaotach:main
Open

[debugger] Add native ratatui TUI debugger PoC for GSOC 2026#4931
alaotach wants to merge 1 commit intorust-lang:masterfrom
alaotach:main

Conversation

@alaotach
Copy link
Copy Markdown

What this PR does

This PR adds the initial Proof-of-Concept for a native TUI debugger for Miri.

The debugger is:

  • Built directly inside the Miri repository (no external process)
  • Uses ratatui + crossterm for a clean terminal interface
  • Hooked straight into the interpreter loop in src/concurrency/thread.rs
  • Zero overhead when --debugger is not passed (single Option check)
  • Fully functional PoC already working on real Miri executions

Features implemented in this PoC

  • Step forward (n / space) through every MIR statement
  • Reverse stepping (b) using snapshot history (up to 1000 states)
  • Run to main (m) with live fast-forward animation
  • Run to end (e)
  • Run to frame (p / P)
  • Live stack search (/)
  • Pretty-printed locals pane with semantic colors (initialized, uninit, dead, pointers)
  • Control-flow graph visualization with current block highlight
  • Output pane capturing stdout/stderr through Miri shims
  • Memory pane showing live/deallocated allocations
  • Mouse support + full status bar with keybinding reference

Demo

Full PoC demo video:
https://drive.google.com/file/d/1VofdVai_xadl83qbdcmp_NBFb5e0o74-/view?usp=sharing

How to test

./miri-run.bat run <file-name> --debugger

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Mar 31, 2026

Thank you for contributing to Miri! A reviewer will take a look at your PR, typically within a week or two.
Please remember to not force-push to the PR branch except when you need to rebase due to a conflict or when the reviewer asks you for it.

@rustbot rustbot added the S-waiting-on-review Status: Waiting for a review to complete label Mar 31, 2026
@oli-obk oli-obk self-assigned this Mar 31, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 12, 2026

☔ The latest upstream changes (possibly #4950) made this pull request unmergeable. Please resolve the merge conflicts.

@zjp-CN
Copy link
Copy Markdown
Contributor

zjp-CN commented Apr 20, 2026

Thanks for the work. I'd like to share the debugger I backported to kmiri (a fork of miri for OS development) based on this PR, with some refactoring and improvements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Waiting for a review to complete

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants