debugger should not give any specific meaning to false.
init must only initialise preds after undef is made. don't give annoying messages in s or t, just continue git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@467 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
d2a6f16e4a
commit
e0a80c43c5
19
C/init.c
19
C/init.c
@ -567,10 +567,16 @@ InitCmpPred(char *Name, int Arity, CmpPredicate cmp_code, CPredicate code, int f
|
|||||||
c_predicates[NUMBER_OF_CPREDS] = code;
|
c_predicates[NUMBER_OF_CPREDS] = code;
|
||||||
pe->StateOfPred = NUMBER_OF_CPREDS;
|
pe->StateOfPred = NUMBER_OF_CPREDS;
|
||||||
NUMBER_OF_CPREDS++;
|
NUMBER_OF_CPREDS++;
|
||||||
|
if (NUMBER_OF_CPREDS == MAX_C_PREDS) {
|
||||||
|
Error(SYSTEM_ERROR, TermNil, "not enough table for c-predicates");
|
||||||
|
}
|
||||||
pe->TrueCodeOfPred = (CODEADDR) cmp_code;
|
pe->TrueCodeOfPred = (CODEADDR) cmp_code;
|
||||||
cmp_funcs[NUMBER_OF_CMPFUNCS].p = pe;
|
cmp_funcs[NUMBER_OF_CMPFUNCS].p = pe;
|
||||||
cmp_funcs[NUMBER_OF_CMPFUNCS].f = cmp_code;
|
cmp_funcs[NUMBER_OF_CMPFUNCS].f = cmp_code;
|
||||||
NUMBER_OF_CMPFUNCS++;
|
NUMBER_OF_CMPFUNCS++;
|
||||||
|
if (NUMBER_OF_CMPFUNCS == MAX_CMP_FUNCS) {
|
||||||
|
Error(SYSTEM_ERROR, TermNil, "not enough table for comparison predicates");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -773,11 +779,9 @@ InitCodes(void)
|
|||||||
heap_regs->seq_def = TRUE;
|
heap_regs->seq_def = TRUE;
|
||||||
heap_regs->getworkfirsttimecode.opc = opcode(_getwork_first_time);
|
heap_regs->getworkfirsttimecode.opc = opcode(_getwork_first_time);
|
||||||
heap_regs->getworkcode.opc = opcode(_getwork);
|
heap_regs->getworkcode.opc = opcode(_getwork);
|
||||||
heap_regs->getworkcode.u.ld.p = (CODEADDR)RepPredProp(PredPropByAtom(LookupAtom("$getwork"), 0));
|
|
||||||
INIT_YAMOP_LTT(&(heap_regs->getworkcode), 0);
|
INIT_YAMOP_LTT(&(heap_regs->getworkcode), 0);
|
||||||
heap_regs->getworkcode_seq.opc = opcode(_getwork_seq);
|
heap_regs->getworkcode_seq.opc = opcode(_getwork_seq);
|
||||||
INIT_YAMOP_LTT(&(heap_regs->getworkcode_seq), 0);
|
INIT_YAMOP_LTT(&(heap_regs->getworkcode_seq), 0);
|
||||||
heap_regs->getworkcode_seq.u.ld.p = (CODEADDR)RepPredProp(PredPropByAtom(LookupAtom("$getwork_seq"), 0));
|
|
||||||
#endif /* YAPOR */
|
#endif /* YAPOR */
|
||||||
#ifdef TABLING
|
#ifdef TABLING
|
||||||
heap_regs->tablecompletioncode.opc = opcode(_table_completion);
|
heap_regs->tablecompletioncode.opc = opcode(_table_completion);
|
||||||
@ -799,9 +803,6 @@ InitCodes(void)
|
|||||||
heap_regs->env_for_trustfail_code.s = -Signed(RealEnvSize);
|
heap_regs->env_for_trustfail_code.s = -Signed(RealEnvSize);
|
||||||
heap_regs->env_for_trustfail_code.l = NULL;
|
heap_regs->env_for_trustfail_code.l = NULL;
|
||||||
heap_regs->env_for_trustfail_code.l2 = NULL;
|
heap_regs->env_for_trustfail_code.l2 = NULL;
|
||||||
heap_regs->env_for_trustfail_code.p =
|
|
||||||
heap_regs->env_for_trustfail_code.p0 =
|
|
||||||
RepPredProp(PredPropByAtom(LookupAtom("false"),0));
|
|
||||||
heap_regs->trustfailcode = opcode(_trust_fail);
|
heap_regs->trustfailcode = opcode(_trust_fail);
|
||||||
|
|
||||||
heap_regs->env_for_yes_code.op = opcode(_call);
|
heap_regs->env_for_yes_code.op = opcode(_call);
|
||||||
@ -1036,6 +1037,7 @@ InitCodes(void)
|
|||||||
undefpe->OpcodeOfPred = UNDEF_OPCODE;
|
undefpe->OpcodeOfPred = UNDEF_OPCODE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/* predicates can only be defined after this point */
|
||||||
heap_regs->env_for_yes_code.p =
|
heap_regs->env_for_yes_code.p =
|
||||||
heap_regs->env_for_yes_code.p0 =
|
heap_regs->env_for_yes_code.p0 =
|
||||||
RepPredProp(PredPropByAtom(heap_regs->atom_true,0));
|
RepPredProp(PredPropByAtom(heap_regs->atom_true,0));
|
||||||
@ -1044,11 +1046,18 @@ InitCodes(void)
|
|||||||
heap_regs->pred_throw = RepPredProp(PredPropByFunc(FunctorThrow,0));
|
heap_regs->pred_throw = RepPredProp(PredPropByFunc(FunctorThrow,0));
|
||||||
heap_regs->pred_handle_throw = RepPredProp(PredPropByFunc(MkFunctor(LookupAtom("$handle_throw"),3),0));
|
heap_regs->pred_handle_throw = RepPredProp(PredPropByFunc(MkFunctor(LookupAtom("$handle_throw"),3),0));
|
||||||
heap_regs->pred_goal_expansion = RepPredProp(PredPropByFunc(MkFunctor(LookupAtom("goal_expansion"),3),1));
|
heap_regs->pred_goal_expansion = RepPredProp(PredPropByFunc(MkFunctor(LookupAtom("goal_expansion"),3),1));
|
||||||
|
heap_regs->env_for_trustfail_code.p =
|
||||||
|
heap_regs->env_for_trustfail_code.p0 =
|
||||||
|
RepPredProp(PredPropByAtom(LookupAtom("false"),0));
|
||||||
{
|
{
|
||||||
/* make sure we know about the module predicate */
|
/* make sure we know about the module predicate */
|
||||||
PredEntry *modp = RepPredProp(PredPropByFunc(heap_regs->functor_module,0));
|
PredEntry *modp = RepPredProp(PredPropByFunc(heap_regs->functor_module,0));
|
||||||
modp->PredFlags |= MetaPredFlag;
|
modp->PredFlags |= MetaPredFlag;
|
||||||
}
|
}
|
||||||
|
#ifdef YAPOR
|
||||||
|
heap_regs->getworkcode.u.ld.p = (CODEADDR)RepPredProp(PredPropByAtom(LookupAtom("$getwork"), 0));
|
||||||
|
heap_regs->getworkcode_seq.u.ld.p = (CODEADDR)RepPredProp(PredPropByAtom(LookupAtom("$getwork_seq"), 0));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
31
pl/debug.yap
31
pl/debug.yap
@ -367,19 +367,6 @@ debugging :-
|
|||||||
'$spycalls'(Mod:G,_,Res) :-
|
'$spycalls'(Mod:G,_,Res) :-
|
||||||
!,
|
!,
|
||||||
'$spycalls'(G,Mod,Res).
|
'$spycalls'(G,Mod,Res).
|
||||||
'$spycalls'(repeat,_,_) :-
|
|
||||||
!,
|
|
||||||
repeat.
|
|
||||||
'$spycalls'(fail,_,_) :-
|
|
||||||
!,
|
|
||||||
fail.
|
|
||||||
'$spycalls'(false,_,_) :-
|
|
||||||
!,
|
|
||||||
false.
|
|
||||||
'$spycalls'(true,_,_) :-
|
|
||||||
!.
|
|
||||||
'$spycalls'(otherwise,_,_) :-
|
|
||||||
!.
|
|
||||||
'$spycalls'(\+ G,Mod,Res) :-
|
'$spycalls'(\+ G,Mod,Res) :-
|
||||||
!,
|
!,
|
||||||
CP is '$last_choice_pt',
|
CP is '$last_choice_pt',
|
||||||
@ -910,12 +897,18 @@ debugging :-
|
|||||||
'$set_value'(spy_sp,call),
|
'$set_value'(spy_sp,call),
|
||||||
'$set_value'(spy_sl,L),
|
'$set_value'(spy_sl,L),
|
||||||
write(user_error,'[ retry ]'), nl(user_error).
|
write(user_error,'[ retry ]'), nl(user_error).
|
||||||
'$action'(0's,P,L,_,_,_) :- !, % s skip
|
'$action'(0's,P,L,_,_,C) :- !, % s skip
|
||||||
( P=call; P=redo; '$ilgl'(115) ), !,
|
( (P=call; P=redo) ->
|
||||||
'$set_value'(spy_sl,L).
|
'$set_value'(spy_sl,L)
|
||||||
'$action'(0't,P,L,_,_,_) :- !, % t fast skip
|
;
|
||||||
( P=call; P=redo; '$ilgl'(116) ), !,
|
C = continue
|
||||||
'$set_value'(spy_sl,L), '$set_value'(spy_fs,1).
|
).
|
||||||
|
'$action'(0't,P,L,_,_,C) :- !, % t fast skip
|
||||||
|
( (P=call; P=redo) ->
|
||||||
|
'$set_value'(spy_sl,L), '$set_value'(spy_fs,1)
|
||||||
|
;
|
||||||
|
C = continue
|
||||||
|
).
|
||||||
'$action'(0'+,_,_,G,M,_) :- !, % + spy this
|
'$action'(0'+,_,_,G,M,_) :- !, % + spy this
|
||||||
functor(G,F,N), spy(M:(F/N)),
|
functor(G,F,N), spy(M:(F/N)),
|
||||||
'$skipeol'(43), fail.
|
'$skipeol'(43), fail.
|
||||||
|
Reference in New Issue
Block a user