5 :- debug/0
debugging/0
leash/1nodebug/0
nospyall/0
notrace/0
trace/0
'$init_debugger'/0
system_module(
'$_debug', [,
16:-
'$find_goal_definition'/4
'$system_catch'/4
use_system_module(
'$_boot', [,
19:-
'$Error'/1
'$do_error'/2
use_system_module(
'$_errors', [,
22:-
'$system_module'/1
use_system_module(
'$_init', []).
24:-
'$meta_expansion'/6
use_system_module(
'$_modules', []).
26:-
'$clause'/4
use_system_module(
'$_preds', []).
61:-
op(
900,fx,[
spy,
nospy]).
68 '$do_error'(instantiation_error,
M:spy(
V,
S)).
69 '$suspy'((
M:S),
P,
_)
:- '$suspy',
71 '$suspy'([],
_,
_)
:- '$suspy'.
72 '$suspy'([
F|L],
S,
M)
:- '$suspy', (
'$suspy'(
F,
S,
M)
; '$suspy'(
L,
S,
M) ).
73 '$suspy'(
F/N,
S,
M)
:- '$suspy',
75 '$do_suspy'(
S,
F,
N,
T,
M).
76 '$suspy'(
A,
S,
M)
:- atom(
A),
atom,
77 '$suspy_predicates_by_name'(
A,
S,
M).
78 '$suspy'(
P,
spy,
M)
:- '$suspy',
79 '$do_error'(domain_error(predicate_spec,
P),
spy(
M:P)).
80 '$suspy'(
P,
nospy,
M)
:-
81 '$do_error'(domain_error(predicate_spec,
P),
nospy(
M:P)).
83 '$suspy_predicates_by_name'(
A,
S,
M)
:-
89 '$do_suspy'(
S,
A,
N,
T,
M),
95 '$suspy_predicates_by_name'(
_A,
_S,
_M).
100'$do_suspy'(
S,
F,
N,
T,
M)
:-
101 '$undefined'(
T,
M),
'$undefined',
107 '$do_suspy'(
S,
F,
N,
T,
M)
:-
108 '$is_system_predicate'(
T,
M),
109 '$predicate_flags'(
T,
M,
Fl,
Fl),
110 Fl /\ 0'$predicate_flags'
=\= 0,
112 '$do_error'(permission_error(access,private_procedure,
T),
spy(
M:F/N))
114 '$do_error'(permission_error(access,private_procedure,
T),
nospy(
M:F/N))
117'$do_suspy'(
S,
F,
N,
T,
M)
:-
118 '$suspy2'(
S,
F,
N,
T,
M).
120 '$suspy2'(
spy,
F,
N,
T,
M)
:-
123 print_message(informational,breakp(bp(debugger,plain,
M:T,
M:F/N,
N),add,already)).
124'$suspy2'(
spy,
F,
N,
T,
M)
:- '$suspy2',
127 print_message(informational,breakp(bp(debugger,plain,
M:T,
M:F/N,
N),add,ok)).
128'$suspy2'(
nospy,
F,
N,
T,
M)
:-
129 recorded(
'$spy',
'$spy'(
T,
M),
R),
recorded,
132 print_message(informational,breakp(bp(debugger,plain,
M:T,
M:F/N,
N),remove,last)).
133'$suspy2'(
nospy,
F,
N,
_,
M)
:-
134 print_message(informational,breakp(no,breakpoint_for,
M:F/N)).
136'$pred_being_spied'(
G,
M)
:-
137 recorded(
'$spy',
'$spy'(
G,
M),
_),
recorded.
152 recorded
:debug_action_hook(
spy(
Spec)),
debug_action_hook.
154 '$current_module'(
M),
155 '$suspy'(
L,
spy,
M),
'$suspy'.
169 '$suspy'
:debug_action_hook(
nospy(
Spec)),
debug_action_hook.
171 '$current_module'(
M),
172 '$suspy'(
L,
nospy,
M),
'$suspy'.
181 '$suspy'
:debug_action_hook(nospyall),
debug_action_hook.
182nospydebug_action_hook
:-
183 recorded(
'$spy',
'$spy'(
T,
M),
_),
functor(
T,
F,
N),
'$suspy'(
F/N,
nospy,
M),
'$suspy'.
192 (
'__NB_getval__'(
'$spy_gn',
_, fail)
-> '__NB_getval__'
; '__NB_setval__'(
'$spy_gn',
1) ),
194 '$set_debugger_state'(debug, true),
195 '$set_debugger_state'(trace, off),
202 '$set_debugger_state'(debug,
Can),
207 '$set_debugger_state'(debug, false),
208 '$set_debugger_state'(trace, off),
224 (
'__NB_getval__'(
'$spy_gn',
_, fail)
-> '__NB_getval__'
; '__NB_setval__'(
'$spy_gn',
1) ),
227 '$set_debugger_state'(debug, true),
228 '$set_debugger_state'(trace, on),
237not'$set_debugger_state'
:-
238 '$set_debugger_state'.
297 '$do_error'(instantiation_error,leash(
X)).
300 '$leashcode'(
X,
Code),
302 '$show_leash'(informational,
Code),
'$show_leash'.
304 '$do_error'(type_error(leash_mode,
X),leash(
X)).
306'$show_leash'(
Msg,
0)
:-
308'$show_leash'(
Msg,
Code)
:-
309 '$check_leash_bit'(
Code,
0x8,
L3,call,
LF),
310 '$check_leash_bit'(
Code,
0x4,
L2,exit,
L3),
311 '$check_leash_bit'(
Code,
0x2,
L1,redo,
L2),
312 '$check_leash_bit'(
Code,
0x1,[],fail,
L1),
315'$check_leash_bit'(
Code,
Bit,
L0,
_,
L0)
:- Bit /\ Code =:= 0,
'$check_leash_bit'.
316'$check_leash_bit'(
_,
_,
L0,
Name,[
Name|L0]).
318'$leashcode'(full,
0xf)
:- '$leashcode'.
319'$leashcode'(on,
0xf)
:- '$leashcode'.
320'$leashcode'(half,
0xb)
:- '$leashcode'.
321'$leashcode'(loose,
0x8)
:- '$leashcode'.
322'$leashcode'(off,
0x0)
:- '$leashcode'.
323'$leashcode'(none,
0x0)
:- '$leashcode'.
325'$leashcode'([
L|M],
Code)
:- '$leashcode',
326 '$list2Code'([
L|M],
Code).
327'$leashcode'(
N,
N)
:- integer(
N),
N >= 0,
N =< 0integer.
329'$list2Code'(
V,
_)
:- var(
V),
var,
330 '$do_error'(instantiation_error,leash(
V)).
331'$list2Code'([],
0)
:- '$list2Code'.
332'$list2Code'([
V|L],
_)
:- var(
V),
var,
333 '$do_error'(instantiation_error,leash([
V|L])).
334'$list2Code'([call
|L],
N)
:- '$list2Code'(
L,
N1),
N is 0'$list2Code'
+ N1.
335'$list2Code'([exit
|L],
N)
:- '$list2Code'(
L,
N1),
N is 0'$list2Code'
+ N1.
336'$list2Code'([redo
|L],
N)
:- '$list2Code'(
L,
N1),
N is 0'$list2Code'
+ N1.
337'$list2Code'([fail
|L],
N)
:- '$list2Code'(
L,
N1),
N is 0'$list2Code'
+ N1.
347 '$list2Code'
:debug_action_hook(nospyall),
debug_action_hook.
354 findall(
M:(
N/A),(recorded(
'$spy',
'$spy'(
T,
M),
_),functor(
T,
N,
A)),
L),
357 '$show_leash'(help,
Leash).
375 '$init_debugger_trace',
376 '__NB_setval__'(
'$if_skip_mode',run),
377 '__NB_setval__'(
'$spy_glist',[]),
378 '__NB_setval__'(
'$spy_gdlist',[]),
379 '__NB_setval__'(
'$spy_gn',
1).
381'$init_debugger_trace' :-
382 '$get_debugger_state'( trace, on ),
383 '$get_debugger_state',
384 '$set_debugger_state'( creep,
0, stop, on, true ).
385'$init_debugger_trace' :-
386 '$set_debugger_state'( zip,
0, stop, off, true ).
393'$enter_debugging'(
G,
Mod,
_CP,
_G0,
_NG)
:-
394 '$creepcalls'(
G,
Mod),
396'$enter_debugging'(
G,
_Mod,
_CP,
_G0,
G).
398'$enter_debugging'(
G,
Mod,
GN)
:-
400 '$set_debugger_state'( debug,
Deb ),
405 '$do_trace'(
G,
Mod,
GN)
412'$exit_debugger'(
Mod:G,
GN)
:-
414 '$set_debugger_state'( debug,
Deb ),
419 '$do_trace'(
G,
Mod,
GN)
462'$debuggable'(
_G,
_Module,
_GoalNo)
:-
466'$debuggable'(
G,
Module,
_GoalNo)
:-
467 '$pred_being_spied'(
G,
Module),
468 '$get_debugger_state'(
spy, stop ),
469 '$get_debugger_state'.
470'$debuggable'(
_G,
_Module,
GoalNo)
:-
471 '$get_debugger_state'( creep, zip ),
472 '$get_debugger_state',
474 '$get_debugger_state'( goal_number,
TargetGoal ),
477'$debuggable'(
_G,
_Module,
_GoalNo).
481'$leap'(
Ports,
GoalNo)
:-
482 '$get_debugger_state'( creep,
L),
490 '$get_debugger_state'( goal_number,
TargetGoal ),
494 GoalNo > TargetGoal ->
501 Ports == [fail,answer]
508'$run_deb'(
Port,
GN0,
GN)
:-
510 '$cross_run_deb'(
Port,
GN0,
GN).
513'$cross_run_deb'(call,
_Ctx,
_GN).
514'$cross_run_deb'(internal,
_Ctx,
_GN).
515'$cross_run_deb'(redo,
Ctx,
_GN)
:-
516 '$continue_debugging'(
Ctx).
517'$cross_run_deb'(fail,
Ctx,
_GN)
:-
518 '$continue_debugging'(
Ctx).
519'$cross_run_deb'(exit,
Ctx,
_GN)
:-
520 '$continue_debugging'(
Ctx).
521'$cross_run_deb'(answer,
Ctx,
_GN)
:-
522 '$continue_debugging'(
Ctx).
523'$cross_run_deb'(exception(
_),
_GN0,
_GN)
:-
524 '$set_debugger_state'(debug,false).
525'$cross_run_deb'(external_exception(
_),
_GN0,
_GN)
:-
526 '$set_debugger_state'(debug,false).
528'$exit_goal'(false,
_GN)
:-
529 '$set_debugger_state'(debug,false).
530'$exit_goal'(true,
GN)
:-
531 '$continue_debugging'(
GN).
533'$continue_debugging'(
_)
:-
536'$continue_debugging'(
_)
:-
537 '$get_debugger_state'(trace, on),
538 '$get_debugger_state'(creep,zip),
539 '$set_debugger_state'(creep,creep),
540 '$set_debugger_state'.
541'$continue_debugging'(outer)
:-
542 '$set_debugger_state'(debug,true).
543'$continue_debugging'(inner).
545'$restart_debugging':-
546 '$set_debugger_state'(debug,
Debug),
547 '$get_debugger_state'(creep,
Creep),
548 '$may_creep'(
Debug,
Creep),
553'$may_creep'(true,creep).
554'$may_creep'(true,leap).
561
current_prolog_flag(? Flag,- Value)
set_prolog_flag(+ Flag,+ Value)
print_message(+ Severity, +Term)