use flag for debugging

This commit is contained in:
Vitor Santos Costa 2013-10-31 13:16:27 +00:00
parent 4b64eafc3d
commit 8ea594c104
3 changed files with 18 additions and 18 deletions

View File

@ -80,7 +80,7 @@ true :- true.
set_value('$gc',on),
('$exit_undefp' -> true ; true),
prompt1(' ?- '),
'$debug_on'(false),
'$swi_set_prolog_flag'(debug, false)
% simple trick to find out if this is we are booting from Prolog.
% boot from a saved state
(
@ -200,7 +200,7 @@ true :- true.
fail.
'$enter_top_level' :-
'$nb_getval'('$break',BreakLevel,fail),
'$debug_on'(DBON),
'$swi_current_prolog_flag'(debug, DBON),
(
'$nb_getval'('$trace', on, fail)
->

View File

@ -326,8 +326,8 @@ break :-
nb_setval('$trace',off),
nb_getval('$debug_jump',Jump),
nb_getval('$debug_run',Run),
'$debug_on'(Debug),
'$debug_on'(false),
'$swi_current_prolog_flag'(debug, Debug),
'$swi_set_prolog_flag'(debug, false)
nb_getval('$break',BL), NBL is BL+1,
nb_getval('$spy_gn',SPY_GN),
b_getval('$spy_glist',GList),
@ -342,7 +342,7 @@ break :-
nb_setval('$spy_gn',SPY_GN),
set_input(InpStream),
set_output(OutStream),
'$debug_on'(Debug),
'$swi_set_prolog_flag'(debug, Debug),
nb_setval('$debug_jump',Jump),
nb_setval('$debug_run',Run),
nb_setval('$trace',Trace),

View File

@ -165,16 +165,16 @@ debug :-
'$start_debugging'(Mode) :-
(Mode == on ->
'$debug_on'(true)
'$swi_set_prolog_flag'(debug, true)
;
'$debug_on'(false)
'$swi_set_prolog_flag'(debug, false)
),
nb_setval('$debug_run',off),
nb_setval('$debug_jump',false).
nodebug :-
'$init_debugger',
'$debug_on'(false),
'$swi_set_prolog_flag'(debug, false),
nb_setval('$trace',off),
print_message(informational,debug(off)).
@ -264,7 +264,7 @@ debugging :-
'$init_debugger',
prolog:debug_action_hook(nospyall), !.
debugging :-
( '$debug_on'(true) ->
( '$swi_current_prolog_flag'(debug, true) ->
print_message(help,debug(debug))
;
print_message(help,debug(off))
@ -307,7 +307,7 @@ debugging :-
%
% $spy may be called from user code, so be careful.
'$spy'([Mod|G]) :-
'$debug_on'(F), F = false, !,
'$swi_current_prolog_flag'(debug, false), !,
'$execute_nonstop'(G,Mod).
'$spy'([Mod|G]) :-
'$in_system_mode', !,
@ -587,7 +587,7 @@ debugging :-
% at this point we are done with leap or skip
nb_setval('$debug_run',off),
% make sure we run this code outside debugging mode.
'$debug_on'(false),
'$swi_set_prolog_flag'(debug, false),
repeat,
'$trace_msg'(P,G,Module,L,Deterministic),
(
@ -600,13 +600,13 @@ debugging :-
),
(Debug = on
->
'$debug_on'(true)
'$swi_set_prolog_flag'(debug, true)
;
Debug = zip
->
'$debug_on'(true)
'$swi_set_prolog_flag'(debug, true)
;
'$debug_on'(false)
'$swi_set_prolog_flag'(debug, false)
),
!.
@ -650,10 +650,10 @@ debugging :-
'$action'(0'!,_,_,_,_,_) :- !, % ! 'g execute
read(user,G),
% don't allow yourself to be caught by creep.
'$debug_on'(OldDeb),
'$debug_on'(false),
'$swi_current_prolog_flag'(debug, OldDeb),
'$swi_set_prolog_flag'(debug, false)
( '$execute'(G) -> true ; true),
'$debug_on'(OldDeb),
'$swi_set_prolog_flag'(debug, OldDeb),
% '$skipeol'(0'!), % '
fail.
'$action'(0'<,_,_,_,_,_) :- !, % <'Depth
@ -732,7 +732,7 @@ debugging :-
nodebug.
'$action'(0'r,_,CallId,_,_,_) :- !, % 'r retry
'$scan_number'(0'r,CallId,ScanNumber), % '
'$debug_on'(true),
'$swi_set_prolog_flag'(debug, true),
throw(error('$retry_spy'(ScanNumber),[])).
'$action'(0's,P,CallNumber,_,_,on) :- !, % 's skip
'$skipeol'(0's), % '