PublicShow sourcetrace.pl --

Allow tracing pengine execution under SWISH.

Source $swish wrapper(:Goal, -Residuals)
Wrap a SWISH goal in '$swish wrapper'. This has two advantages: we can detect that the tracer is operating on a SWISH goal by inspecting the stack and we can save/restore the debug state to deal with debugging next solutions.
Source pengines:prepare_goal(+GoalIn, -GoalOut, +Options) is semidet[multifile]
Handle the breakpoints(List) option to set breakpoints prior to execution of the query. If breakpoints are present and enabled, the goal is executed in debug mode. List is a list, holding a dict for each source that has breakpoints. The dict contains these keys:
  • file is the source file. For the current Pengine source this is pengine://<pengine>/src.
  • breakpoints is a list of lines (integers) where to put break points.
Source prolog_clause:open_source(+File, -Stream) is semidet[multifile]
Open SWISH non-file sources.