I wrote a blog post about adding command history browsing and editing, as well as tab completion, to ocamldebug, without typing a single line of code. I challenge you to review the PR for fun, and to try to find holes in it!
I’m going to add DWARF debugging information to OCaml next. I think it’s almost ready to go but needs double and triple checking. Commits look like this
Date: Thu Nov 13 14:55:24 2025 +0200
Add DWARF tests for basic functionality
Add minimal tests to verify DWARF emission works correctly with -g flag.
Tests compile OCaml programs with debugging enabled and verify correct
execution.
and
Date: Thu Nov 13 14:54:30 2025 +0200
Implement DWARF v4 debugging support for OCaml
Add complete DWARF version 4 debugging information generation for OCaml
native code. The implementation generates debug info for functions, types,
and line numbers, enabling debugger support for OCaml programs.Key components:
- Low-level DWARF primitives (tags, attributes, forms, encodings)
- Debug Information Entries (DIE) construction
- Line number program generation
- String table management with offset tracking
- Code address tracking and relocation
- Integration with OCaml compilation pipeline
- Configuration flags to enable/disable DWARF emission
The implementation follows the DWARF 4 specification and generates
valid debug sections (.debug_info, .debug_line, .debug_str, .debug_abbrev)
that can be consumed by standard debuggers like gdb and lldb.