Did you know ... Search Documentation:
Pack logicmoo_utils -- prolog/debuggery/rtrace.pl
PublicShow source
 on_f_rtrace(:Goal) is det
If :Goal fails trace it
 on_x_debug(:Goal) is det
If there If Is an exception in :Goal then rtrace.
 maybe_leash(+Flags) is det
Only leashes interactive consoles
 push_guitracer is det
Save Guitracer.
 pop_guitracer is det
Restore Guitracer.
 push_tracer is det
Push Tracer.
 pop_tracer is det
Pop Tracer.
 reset_tracer is det
Reset Tracer.
 quietly(:Goal) is nondet
Unlike notrace/1, it allows nondet tracing

But also may be break when excpetions are raised during Goal.

version 21

 rtrace is det
Start RTracer.
 srtrace is det
Start RTracer.
 nortrace is det
Stop Tracer.
 restore_trace(:Goal) is det
restore Trace.

! restore_trace( :Goal) is det.

restore Trace.

 rtrace(:Goal) is nondet
Trace a goal non-interactively until the first exception on total failure

?- rtrace(member(X,[1,2,3])). Call: (9) [lists] lists:member(_7172, [1, 2, 3]) Unify: (9) [lists] lists:member(_7172, [1, 2, 3]) Call: (10) [lists] lists:member_([2, 3], _7172, 1) Unify: (10) [lists] lists:member_([2, 3], 1, 1) Exit: (10) [lists] lists:member_([2, 3], 1, 1) Exit: (9) [lists] lists:member(1, [1, 2, 3]) X = 1 ; Redo: (10) [lists] lists:member_([2, 3], _7172, 1) Unify: (10) [lists] lists:member_([2, 3], _7172, 1) Call: (11) [lists] lists:member_([3], _7172, 2) Unify: (11) [lists] lists:member_([3], 2, 2) Exit: (11) [lists] lists:member_([3], 2, 2) Exit: (10) [lists] lists:member_([2, 3], 2, 1) Exit: (9) [lists] lists:member(2, [1, 2, 3]) X = 2 ; Redo: (11) [lists] lists:member_([3], _7172, 2) Unify: (11) [lists] lists:member_([3], _7172, 2) Call: (12) [lists] lists:member_([], _7172, 3) Unify: (12) [lists] lists:member_([], 3, 3) Exit: (12) [lists] lists:member_([], 3, 3) Exit: (11) [lists] lists:member_([3], 3, 2) Exit: (10) [lists] lists:member_([2, 3], 3, 1) Exit: (9) [lists] lists:member(3, [1, 2, 3]) X = 3.

?- rtrace(fail). Call: (9) [system] fail Fail: (9) [system] fail ^ Redo: (8) [rtrace] rtrace:rtrace(user:fail) false.

 rtrace_break(:Goal) is nondet
Trace a goal non-interactively and break on first exception or on total failure
 ftrace(:Goal) is nondet
Trace failure.

Undocumented predicates

The following predicates are exported, but not or incorrectly documented.

 restart_rtrace
 tAt_rtrace
 should_maybe_leash
 non_user_console
 visible_rtrace(Arg1, Arg2)
 on_x_rtrace(Arg1)
 call_call(Arg1)
 restart_rtrace
 old_swi(Arg1)