Breakpoint[]
This can be used for debugging the Mathics3 implementation, but if you are familiar with Python, it might assist in debugging a Mathics3 programs as well.
By default, the Python debugger (pdb
) is loaded. For loading other debuggers, change the environment variable PYTHONBREAKPOINT
.
Mathics3 code includes a breakpoint handler function, mathics.disabled_breakpoint
which reports whether Breakpoint[]
was encountered in Mathics3, or breakpoint()
was encountered in the Mathics3 source code. In contrast to pdb
, trepan3k
and other handlers, this breakpoint handler does not stop inside, it just reports.
Here is how to use mathics.disabled_breakpoint
:
SetEnvironment["PYTHONBREAKPOINT" -> "mathics.disabled_breakpoint"];
Breakpoint[]
The environment variable PYTHONBREAKPOINT
can be changed at runtime to switch breakpoint()
and Breakpoint[]
behavior.