A small LLDB Python plug-in reads OCaml values at runtime and prints them in a readable form: lists, tuples, closures, strings, etc. It follows DWARF location lists to track where each variable lives and uses the runtime headers to decode them. The `p` and `ocaml_vars` commands work like normal LLDB commands but understand OCaml values.
It’s not complete yet (records and variants still show as tuples), but it makes debugging native OCaml code straightforward. You can finally set breakpoints by source, inspect locals, and understand what’s in memory without switching to disassembly.
Claude Sonnet 4.5 (Claude Code) wrote most of it with ChatGPT 5 (Codex) reviewing and Claude addressing issues in each review. Codex wrote the last 10% or so when Claude kept getting stuck.
I did not write a single line of code but carefully shepherded AI over the course of several days and kept it on the straight and narrow.
- AI: I need to keep track of variables moving across registers. This is too hard, let’s go shopping… - Me: Hey, don’t any no shortcuts!
My work was just directing, shaping, cajoling and reviewing.