I Embedded a Programming Language In Debug Information
summary
Claims that DWARF Expressions are Turing-complete and demonstrates it by embedding a BF interpreter inside debug info. Implements a textual assembler to emit binary DWARF, hand-writes an ELF with the interpreter in the debug_loc section and the BF program in the string table, and generates a massive pick table (compile-time picks up to 255) to emulate runtime indexing. Result: ~2,800 DWARF instructions, ~80,000 executed to compute Fibonacci(6)=8, no stdin/stdout support, limited to ≈250 mutable cells, and it runs under unmodified GDB.
AI-written summary · about
chapters (14)
- 0:00Introduction
- 0:22Project motivation
- 1:04DWARF debug format
- 3:30DWARF expressions
- 5:18DWARF assembler
- 9:10ELF files role
- 11:56Building ELF by hand
- 17:19BF programming language
- 19:11BF interpreter in DWARF
- 21:20BF in DWARF challenges
- 25:59Memory management
- 27:27Function calls without native support
- 28:53Running embedded interpreter
- 29:58Performance and thoughts
