pyteal icon indicating copy to clipboard operation
pyteal copied to clipboard

Expose a `debug` compile option

Open barnjamin opened this issue 3 years ago • 1 comments

Problem

It is difficult to map the pc returned from a failed transaction back to the PyTeal source line that caused it.

Solution

Add a debug: bool flag to the compile options and, if set to True, Assert should return something like:

    return Assert(And(thing_being_asserted, Int(currentframe().f_back.f_lineno)))

This allows the small 3 line stack of the failing program to contain the python source line number.

Other possible debug flag changes might include adding comments to the source teal for source file names or line numbers.

barnjamin avatar Apr 18 '22 11:04 barnjamin

A first attempt by Zeph here: https://github.com/algorand/pyteal/pull/650, we are making src-mapper more performant

ahangsu avatar Mar 08 '23 15:03 ahangsu