trace fixes
This commit is contained in:
parent
88e188bece
commit
fba3c34e50
1
C/exec.c
1
C/exec.c
@ -174,7 +174,6 @@ do_execute(Term t, Term mod USES_REGS)
|
||||
return CallMetaCall(ARG1, mod PASS_REGS);
|
||||
} else if (LOCAL_ActiveSignals && !LOCAL_InterruptsDisabled &&
|
||||
!(LOCAL_PrologMode & (AbortMode|InterruptMode|SystemMode))) {
|
||||
printf("here %lx\n", LOCAL_PrologMode);
|
||||
return EnterCreepMode(t, mod PASS_REGS);
|
||||
}
|
||||
restart_exec:
|
||||
|
14
C/signals.c
14
C/signals.c
@ -71,6 +71,19 @@ p_creep( USES_REGS1 )
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static Int
|
||||
p_creep_fail( USES_REGS1 )
|
||||
{
|
||||
Atom at;
|
||||
PredEntry *pred;
|
||||
|
||||
at = AtomCreep;
|
||||
pred = RepPredProp(PredPropByFunc(Yap_MkFunctor(at, 1),0));
|
||||
CreepCode = pred;
|
||||
do_signal(YAP_CREEP_SIGNAL PASS_REGS);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static Int
|
||||
p_stop_creeping( USES_REGS1 )
|
||||
{
|
||||
@ -316,6 +329,7 @@ Yap_InitSignalCPreds(void)
|
||||
{
|
||||
/* Basic predicates for the debugger */
|
||||
Yap_InitCPred("$creep", 0, p_creep, SafePredFlag);
|
||||
Yap_InitCPred("$creep_fail", 0, p_creep_fail, SafePredFlag);
|
||||
Yap_InitCPred("$meta_creep", 0, p_meta_creep, SafePredFlag);
|
||||
Yap_InitCPred("$stop_creeping", 0, p_stop_creeping, SafePredFlag);
|
||||
Yap_InitCPred ("$first_signal", 1, p_first_signal, SafePredFlag|SyncPredFlag);
|
||||
|
@ -1220,7 +1220,7 @@ catch_ball(C, C).
|
||||
|
||||
'$exit_system_mode' :-
|
||||
'$system_mode'(false),
|
||||
( '$nb_getval'('$trace',on,fail) -> '$creep' ; true).
|
||||
( '$nb_getval'('$trace',on,fail) -> '$meta_creep' ; true).
|
||||
|
||||
'$run_at_thread_start' :-
|
||||
recorded('$thread_initialization',M:D,_),
|
||||
|
24
pl/debug.yap
24
pl/debug.yap
@ -31,7 +31,7 @@
|
||||
nb_setval('$spy_glist',[]),
|
||||
nb_setval('$spy_gn',1),
|
||||
nb_setval('$debug_run',off),
|
||||
nb_setval('$debug_jump',off).
|
||||
nb_setval('$debug_jump',false).
|
||||
|
||||
|
||||
% First part : setting and reseting spy points
|
||||
@ -193,9 +193,7 @@ trace :-
|
||||
|
||||
'$do_trace' :-
|
||||
'$init_debugger',
|
||||
'$nb_getval'('$trace', on, fail), !,
|
||||
'$start_debugging'(on),
|
||||
'$creep'.
|
||||
'$nb_getval'('$trace', on, fail), !.
|
||||
'$do_trace' :-
|
||||
nb_setval('$trace',on),
|
||||
'$start_debugging'(on),
|
||||
@ -778,18 +776,22 @@ debugging :-
|
||||
'$continue_debugging'(_, debugger) :- !.
|
||||
% do not need to debug!
|
||||
% go back to original sequence.
|
||||
'$continue_debugging'(zip, _) :- !, '$exit_system_mode'.
|
||||
'$continue_debugging'(fail, _) :- !.
|
||||
'$continue_debugging'(exit, meta_creep) :- !,
|
||||
'$exit_system_mode',
|
||||
'$system_mode'(false),
|
||||
'$meta_creep'.
|
||||
'$continue_debugging'(zip, _) :- !, '$exit_system_mode'.
|
||||
'$continue_debugging'(fail, creep) :- !,
|
||||
'$system_mode'(false),
|
||||
'$creep_fail'.
|
||||
'$continue_debugging'(_, creep) :- !,
|
||||
'$exit_system_mode',
|
||||
'$creep'.
|
||||
'$creep',
|
||||
'$system_mode'(false).
|
||||
'$continue_debugging'(fail, _) :- !.
|
||||
'$continue_debugging'(_, spy) :- !,
|
||||
'$exit_system_mode',
|
||||
'$system_mode'(false),
|
||||
'$creep'.
|
||||
'$continue_debugging'(_, _) :- '$exit_system_mode'.
|
||||
'$continue_debugging'(_, _) :-
|
||||
'$exit_system_mode'.
|
||||
|
||||
% if we are in the interpreter, don't need to care about forcing a trace, do we?
|
||||
'$continue_debugging_goal'(yes,G) :- !,
|
||||
|
@ -205,4 +205,5 @@ read_sig.
|
||||
:- '$set_no_trace'('$enter_system_mode', prolog).
|
||||
:- '$set_no_trace'('$do_trace', prolog).
|
||||
:- '$set_no_trace'('$call'(_,_,_,_), prolog).
|
||||
:- '$set_no_trace'('$execute_nonstop'(_,_), prolog).
|
||||
|
||||
|
Reference in New Issue
Block a user