elipl/debug.md
Kacper Marzecki a78fe0541a wip debug
2025-06-20 10:28:53 +02:00

11 lines
815 B
Markdown

i have a compiler Im writing in elixir. I need to trace execution of logic to pinpoint bugs.
I have many tests I want to debug individually but I can run only the full test suite.
I want to create a couple of macros/functions that'd enable me to debug my code.
the scenario I imagine:
before the test I want to debug I write `Tdd.Debug.enable` and then :
as the code is being executed, it prints out a tree of called functions, their arguments and return values, effectively building a stacktrace as its being executed.
first lets design how we'd print this information and if/what should we store in memory to be able to render it in a shape sufficient for good debugging.
Then lets design an elixir module that compiler modules would 'use'
e.g. a Tdd.Debug module that'd have and override for elixir `def`.