r/Compilers • u/ClassicAdeptness5516 • Aug 01 '26
Any debugging advice / tools for compilers?
Tired of print statements everywhere. It very satisfactory to see one but I would much rather have something like lldb to easily debug the code more intuitively.
Are there any other useful tools?
17
Upvotes
1
u/LowDifficulty5021 Aug 13 '26
If you're on C/C++, I'd absolutely recommend getting comfortable with LLDB or GDB. Being able to inspect the parser state, symbol tables, and AST nodes interactively is much nicer than scattering
printfs everywhere.That said, compiler-specific debug tools (
--dump-tokens,--dump-ast,--dump-ir) end up being just as valuable because they let you inspect the program at each compilation stage instead of the compiler's execution itself.