errors
This commit is contained in:
parent
3d8ef251a5
commit
bc3555dfbf
@ -789,7 +789,6 @@ yamop *Yap_Error__(bool throw, const char *file, const char *function, int linen
|
|||||||
return P;
|
return P;
|
||||||
}
|
}
|
||||||
//reset_error_description();
|
//reset_error_description();
|
||||||
fprintf(stderr,"HR before jmp=%p\n", HR);
|
|
||||||
// if (!throw) {
|
// if (!throw) {
|
||||||
Yap_JumpToEnv();
|
Yap_JumpToEnv();
|
||||||
// }
|
// }
|
||||||
@ -990,7 +989,7 @@ const char *Yap_errorClassName(yap_error_class_number e) {
|
|||||||
static Int read_exception(USES_REGS1) {
|
static Int read_exception(USES_REGS1) {
|
||||||
yap_error_descriptor_t *t = AddressOfTerm(Deref(ARG1));
|
yap_error_descriptor_t *t = AddressOfTerm(Deref(ARG1));
|
||||||
Term rc = mkerrort(t->errorNo, Yap_BufferToTerm(t->culprit, TermNil), err2list(t));
|
Term rc = mkerrort(t->errorNo, Yap_BufferToTerm(t->culprit, TermNil), err2list(t));
|
||||||
Yap_DebugPlWriteln(rc);
|
// Yap_DebugPlWriteln(rc);
|
||||||
return Yap_unify(ARG2, rc);
|
return Yap_unify(ARG2, rc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1004,7 +1003,7 @@ const char *Yap_errorClassName(yap_error_class_number e) {
|
|||||||
query = StringOfTerm(t);
|
query = StringOfTerm(t);
|
||||||
yap_error_descriptor_t *y = AddressOfTerm(Deref(ARG2));
|
yap_error_descriptor_t *y = AddressOfTerm(Deref(ARG2));
|
||||||
Term rc = queryErr(query, y);
|
Term rc = queryErr(query, y);
|
||||||
Yap_DebugPlWriteln(rc);
|
// Yap_DebugPlWriteln(rc);
|
||||||
return Yap_unify(ARG3, rc);
|
return Yap_unify(ARG3, rc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
1
C/eval.c
1
C/eval.c
@ -93,7 +93,6 @@ static Term get_matrix_element(Term t1, Term t2 USES_REGS) {
|
|||||||
static Term Eval(Term t USES_REGS) {
|
static Term Eval(Term t USES_REGS) {
|
||||||
|
|
||||||
if (IsVarTerm(t)) {
|
if (IsVarTerm(t)) {
|
||||||
fprintf(stderr,"HR before jmp=%p v=%p\n", HR, VarOfTerm(t));
|
|
||||||
Yap_ArithError(INSTANTIATION_ERROR, t, "in arithmetic");
|
Yap_ArithError(INSTANTIATION_ERROR, t, "in arithmetic");
|
||||||
} else if (IsNumTerm(t)) {
|
} else if (IsNumTerm(t)) {
|
||||||
return t;
|
return t;
|
||||||
|
12
C/exec.c
12
C/exec.c
@ -917,7 +917,6 @@ static Int setup_call_catcher_cleanup(USES_REGS1) {
|
|||||||
Int oENV = LCL0 - ENV;
|
Int oENV = LCL0 - ENV;
|
||||||
Int oYENV = LCL0 - YENV;
|
Int oYENV = LCL0 - YENV;
|
||||||
bool rc;
|
bool rc;
|
||||||
fprintf(stderr, "HR before catch=%p--%p\n", HR, B );
|
|
||||||
Yap_DisableInterrupts(worker_id);
|
Yap_DisableInterrupts(worker_id);
|
||||||
rc = Yap_RunTopGoal(Setup, false);
|
rc = Yap_RunTopGoal(Setup, false);
|
||||||
Yap_EnableInterrupts(worker_id);
|
Yap_EnableInterrupts(worker_id);
|
||||||
@ -1469,7 +1468,6 @@ static bool exec_absmi(bool top, yap_reset_t reset_mode USES_REGS) {
|
|||||||
}
|
}
|
||||||
YENV = ASP;
|
YENV = ASP;
|
||||||
YENV[E_CB] = Unsigned(B);
|
YENV[E_CB] = Unsigned(B);
|
||||||
fprintf(stderr, "HR before absmi(%d)=%p--%p\n", lval, HR, B);
|
|
||||||
out = Yap_absmi(0);
|
out = Yap_absmi(0);
|
||||||
/* make sure we don't leave a FAIL signal hanging around */
|
/* make sure we don't leave a FAIL signal hanging around */
|
||||||
Yap_get_signal(YAP_FAIL_SIGNAL);
|
Yap_get_signal(YAP_FAIL_SIGNAL);
|
||||||
@ -1528,8 +1526,6 @@ static bool do_goal(yamop *CodeAdr, int arity, CELL *pt, bool top USES_REGS) {
|
|||||||
choiceptr saved_b = B;
|
choiceptr saved_b = B;
|
||||||
bool out;
|
bool out;
|
||||||
|
|
||||||
fprintf(stderr,"B before PrepGoal=%p\n", B);
|
|
||||||
|
|
||||||
Yap_PrepGoal(arity, pt, saved_b PASS_REGS);
|
Yap_PrepGoal(arity, pt, saved_b PASS_REGS);
|
||||||
CACHE_A1();
|
CACHE_A1();
|
||||||
P = (yamop *)CodeAdr;
|
P = (yamop *)CodeAdr;
|
||||||
@ -2031,11 +2027,11 @@ bool is_cleanup_cp(choiceptr cp_b) {
|
|||||||
// DBTerm *dbt = Yap_RefToException();
|
// DBTerm *dbt = Yap_RefToException();
|
||||||
while (handler
|
while (handler
|
||||||
&& Yap_PredForChoicePt(handler, NULL) != PredDollarCatch
|
&& Yap_PredForChoicePt(handler, NULL) != PredDollarCatch
|
||||||
//&& LOCAL_CBorder < LCL0 - (CELL *)handler && handler->cp_ap != NOCODE
|
&& LOCAL_CBorder < LCL0 - (CELL *)handler && handler->cp_ap != NOCODE
|
||||||
//&& handler->cp_b != NULL
|
&& handler->cp_b != NULL
|
||||||
) {
|
) {
|
||||||
if (handler->cp_ap != NOCODE)
|
//if (handler->cp_ap != NOCODE)
|
||||||
handler->cp_ap = TRUSTFAILCODE;
|
// handler->cp_ap = TRUSTFAILCODE;
|
||||||
handler = handler->cp_b;
|
handler = handler->cp_b;
|
||||||
}
|
}
|
||||||
pop_text_stack(1);
|
pop_text_stack(1);
|
||||||
|
@ -1673,9 +1673,6 @@ static Term attvars_in_complex_term(register CELL *pt0, register CELL *pt0_end,
|
|||||||
++ pt0;
|
++ pt0;
|
||||||
ptd0 = pt0;
|
ptd0 = pt0;
|
||||||
d0 = *ptd0;
|
d0 = *ptd0;
|
||||||
printf("%p--%p -> %lx\n", ptd0, pt0_end, d0);
|
|
||||||
//Yap_DebugPlWriteln(d0);
|
|
||||||
|
|
||||||
deref_head(d0, attvars_in_term_unk);
|
deref_head(d0, attvars_in_term_unk);
|
||||||
attvars_in_term_nvar:
|
attvars_in_term_nvar:
|
||||||
{
|
{
|
||||||
@ -1733,7 +1730,6 @@ static Term attvars_in_complex_term(register CELL *pt0, register CELL *pt0_end,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
arity_t a = ArityOfFunctor(f);
|
arity_t a = ArityOfFunctor(f);
|
||||||
printf("%p %d %p\n", f, a, ap2);
|
|
||||||
pt0 = ap2;
|
pt0 = ap2;
|
||||||
pt0_end = ap2 + a;
|
pt0_end = ap2 + a;
|
||||||
}
|
}
|
||||||
@ -1790,7 +1786,7 @@ static Term attvars_in_complex_term(register CELL *pt0, register CELL *pt0_end,
|
|||||||
to_visit --;
|
to_visit --;
|
||||||
pt0 = to_visit->beg;
|
pt0 = to_visit->beg;
|
||||||
pt0_end = to_visit->end;
|
pt0_end = to_visit->end;
|
||||||
*pt0 = (CELL)to_visit[2];
|
*pt0 = to_visit->oval;
|
||||||
#else
|
#else
|
||||||
to_visit -= 2;
|
to_visit -= 2;
|
||||||
pt0 = to_visit[0];
|
pt0 = to_visit[0];
|
||||||
@ -1817,9 +1813,9 @@ static Term attvars_in_complex_term(register CELL *pt0, register CELL *pt0_end,
|
|||||||
trail_overflow:
|
trail_overflow:
|
||||||
#ifdef RATIONAL_TREES
|
#ifdef RATIONAL_TREES
|
||||||
while (to_visit > to_visit0) {
|
while (to_visit > to_visit0) {
|
||||||
to_visit -= 3;
|
to_visit --;
|
||||||
pt0 = to_visit[0];
|
pt0 = to_visit->beg;
|
||||||
*pt0 = (CELL)to_visit[2];
|
*pt0 = to_visit->oval;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
LOCAL_Error_TYPE = RESOURCE_ERROR_TRAIL;
|
LOCAL_Error_TYPE = RESOURCE_ERROR_TRAIL;
|
||||||
@ -1843,9 +1839,9 @@ goto restart;
|
|||||||
global_overflow:
|
global_overflow:
|
||||||
#ifdef RATIONAL_TREES
|
#ifdef RATIONAL_TREES
|
||||||
while (to_visit > to_visit0) {
|
while (to_visit > to_visit0) {
|
||||||
to_visit -= 3;
|
to_visit --;
|
||||||
pt0 = to_visit[0];
|
pt0 = to_visit->beg;
|
||||||
*pt0 = (CELL)to_visit[2];
|
*pt0 = to_visit->oval;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
clean_tr(TR0 PASS_REGS);
|
clean_tr(TR0 PASS_REGS);
|
||||||
|
@ -405,7 +405,8 @@ Term Yap_InnerEval__(Term USES_REGS);
|
|||||||
Yap_ThrowError__(__FILE__, __FUNCTION__, __LINE__, id, t, __VA_ARGS__)
|
Yap_ThrowError__(__FILE__, __FUNCTION__, __LINE__, id, t, __VA_ARGS__)
|
||||||
|
|
||||||
#define Yap_ArithError(id, t, ...) \
|
#define Yap_ArithError(id, t, ...) \
|
||||||
Yap_ThrowError__(__FILE__, __FUNCTION__, __LINE__, id, t, __VA_ARGS__)
|
{ Yap_Error__(false,__FILE__, __FUNCTION__, __LINE__, id, t, __VA_ARGS__); return 0L; }
|
||||||
|
|
||||||
#define Yap_BinError(id) \
|
#define Yap_BinError(id) \
|
||||||
Yap_Error__(false, __FILE__, __FUNCTION__, __LINE__, id, 0L, "")
|
Yap_Error__(false, __FILE__, __FUNCTION__, __LINE__, id, 0L, "")
|
||||||
#define Yap_AbsmiError(id) \
|
#define Yap_AbsmiError(id) \
|
||||||
@ -435,6 +436,8 @@ inline static void Yap_ClearExs(void) {}
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
inline static yap_error_number Yap_FoundArithError__(USES_REGS1) {
|
inline static yap_error_number Yap_FoundArithError__(USES_REGS1) {
|
||||||
|
if (LOCAL_PrologMode & InErrorMode)
|
||||||
|
return YAP_NO_ERROR;
|
||||||
if (LOCAL_Error_TYPE != YAP_NO_ERROR )
|
if (LOCAL_Error_TYPE != YAP_NO_ERROR )
|
||||||
return LOCAL_Error_TYPE;
|
return LOCAL_Error_TYPE;
|
||||||
if (trueGlobalPrologFlag(
|
if (trueGlobalPrologFlag(
|
||||||
|
@ -610,8 +610,7 @@ be lost.
|
|||||||
( Skip == creep -> true; '$id_goal'(GoalNumber) ; GoalNumber =< Border),
|
( Skip == creep -> true; '$id_goal'(GoalNumber) ; GoalNumber =< Border),
|
||||||
!,
|
!,
|
||||||
'__NB_setval__'('$debug_status', state(creep, 0, stop)),
|
'__NB_setval__'('$debug_status', state(creep, 0, stop)),
|
||||||
'$trace_port_'(Port, GoalNumber, G, Module, Info),
|
'$trace_port_'(Port, GoalNumber, G, Module, Info).
|
||||||
writeln(Port:G).
|
|
||||||
'$trace_port'(_Port, _GoalNumber, _G, _Module, _CalledFromDebugger, _Info).
|
'$trace_port'(_Port, _GoalNumber, _G, _Module, _CalledFromDebugger, _Info).
|
||||||
|
|
||||||
'$trace_port_'(call, GoalNumber, G, Module, Info) :-
|
'$trace_port_'(call, GoalNumber, G, Module, Info) :-
|
||||||
|
@ -251,7 +251,8 @@ location(error(style_check(style_check(_,LN,FileName,_ ) ),_), _ , _) -->
|
|||||||
[ '~a:~d:0 ' - [FileName,LN] ] .
|
[ '~a:~d:0 ' - [FileName,LN] ] .
|
||||||
location( error(_,Desc), Level, LC ) -->
|
location( error(_,Desc), Level, LC ) -->
|
||||||
{ source_location(F0, L),
|
{ source_location(F0, L),
|
||||||
stream_property(_Stream, alias(loop_stream)) }, !,
|
stream_property(_Stream, alias(loop_stream)),
|
||||||
|
!,
|
||||||
'$query_exception'(prologPredModule, Desc, M),
|
'$query_exception'(prologPredModule, Desc, M),
|
||||||
'$query_exception'(prologPredName, Desc, Na),
|
'$query_exception'(prologPredName, Desc, Na),
|
||||||
'$query_exception'(prologPredArity, Desc, Ar),
|
'$query_exception'(prologPredArity, Desc, Ar),
|
||||||
@ -259,7 +260,7 @@ location( error(_,Desc), Level, LC ) -->
|
|||||||
},
|
},
|
||||||
[ '~a:~d:0 ~a in ~a:~q/~d:'-[F0, L,Level,M,Na,Ar] ].
|
[ '~a:~d:0 ~a in ~a:~q/~d:'-[F0, L,Level,M,Na,Ar] ].
|
||||||
location( error(_,Desc), Level, LC ) -->
|
location( error(_,Desc), Level, LC ) -->
|
||||||
'$query_exception'(prologPredFile, Desc, File),
|
{ '$query_exception'(prologPredFile, Desc, File),
|
||||||
display_consulting( File, Level, LC ),
|
display_consulting( File, Level, LC ),
|
||||||
'$query_exception'(prologPredLine, Desc, FilePos),
|
'$query_exception'(prologPredLine, Desc, FilePos),
|
||||||
'$query_exception'(prologPredModule, Desc, M),
|
'$query_exception'(prologPredModule, Desc, M),
|
||||||
@ -607,7 +608,7 @@ domain_error(Domain, Opt) -->
|
|||||||
extra_info( error(_,Extra), _ ) -->
|
extra_info( error(_,Extra), _ ) -->
|
||||||
{
|
{
|
||||||
'$query_exception'(prologPredFile, Extra, Msg),
|
'$query_exception'(prologPredFile, Extra, Msg),
|
||||||
Msg != []
|
Msg \= []
|
||||||
},
|
},
|
||||||
!,
|
!,
|
||||||
['~*|user provided data is: ~q' - [10,Msg]],
|
['~*|user provided data is: ~q' - [10,Msg]],
|
||||||
|
@ -936,7 +936,6 @@ catch(G, C, A) :-
|
|||||||
'$catch'(M:G,C,A).
|
'$catch'(M:G,C,A).
|
||||||
|
|
||||||
'$catch'(MG,_,_) :-
|
'$catch'(MG,_,_) :-
|
||||||
writeln(MG),
|
|
||||||
'$$save_by'(CP0),
|
'$$save_by'(CP0),
|
||||||
'$execute'(MG),
|
'$execute'(MG),
|
||||||
'$$save_by'(CP1),
|
'$$save_by'(CP1),
|
||||||
|
Reference in New Issue
Block a user