debugging

This commit is contained in:
Vitor Santos Costa
2018-05-24 12:00:10 +01:00
parent ebe4ba266e
commit bb2d06fac9
19 changed files with 106 additions and 106 deletions

View File

@@ -35,14 +35,13 @@ X_API bool do_init_python(void);
static void YAPCatchError()
{
if (LOCAL_CommittedError != nullptr &&
if (false && LOCAL_CommittedError != nullptr &&
LOCAL_CommittedError->errorNo != YAP_NO_ERROR ) {
// Yap_PopTermFromDB(info->errorTerm);
// throw throw YAPError( );
Term es[2];
es[0] = TermError;
es[1] = MkErrorTerm(LOCAL_CommittedError);
LOCAL_CommittedError = nullptr;
Functor f = Yap_MkFunctor(Yap_LookupAtom("print_message"), 2);
YAP_RunGoalOnce(Yap_MkApplTerm(f, 2, es));
// Yap_PopTermFromDB(info->errorTerm);
@@ -550,21 +549,11 @@ bool YAPEngine::mgoal(Term t, Term tmod) {
__android_log_print(ANDROID_LOG_INFO, "YAPDroid", "exec ");
result = (bool)YAP_EnterGoal(ap, nullptr, &q);
if (LOCAL_CommittedError != nullptr &&
LOCAL_CommittedError->errorNo != YAP_NO_ERROR) {
throw YAPError(LOCAL_CommittedError);
}
{
YAP_LeaveGoal(result, &q);
if (LOCAL_CommittedError != nullptr &&
LOCAL_CommittedError->errorNo != YAP_NO_ERROR) {
throw YAPError(LOCAL_CommittedError);
}
// PyEval_RestoreThread(_save);
RECOVER_MACHINE_REGS();
return result;
}
} catch (...) {
} catch (...) {
YAPCatchError();
// free(LOCAL_CommittedError);
@@ -697,12 +686,12 @@ YAPQuery::YAPQuery(YAPTerm t) : YAPPredicate(t) {
}
openQuery();
names = YAPPairTerm(TermNil);
RECOVER_MACHINE_REGS();
}
YAPQuery::YAPQuery(YAPPredicate p, YAPTerm ts[]) : YAPPredicate(p.ap) {
BACKUP_MACHINE_REGS();
arity_t arity = p.ap->ArityOfPE;
try {
arity_t arity = p.ap->ArityOfPE;
if (arity) {
goal = YAPApplTerm(YAPFunctor(p.ap->FunctorOfPred), ts).term();
for (arity_t i = 0; i < arity; i++)
@@ -713,7 +702,10 @@ YAPQuery::YAPQuery(YAPPredicate p, YAPTerm ts[]) : YAPPredicate(p.ap) {
openQuery();
}
names = TermNil;
RECOVER_MACHINE_REGS();
} catch (...) {
}
RECOVER_MACHINE_REGS();
}
bool YAPQuery::next() {
@@ -774,7 +766,7 @@ void YAPQuery::cut() {
BACKUP_MACHINE_REGS();
if (!q_open || q_state == 0)
return;
YAP_LeaveGoal(FALSE, &q_h);
YAP_LeaveGoal(true, &q_h);
q_open = false;
// LOCAL_execution = this;
RECOVER_MACHINE_REGS();
@@ -803,7 +795,7 @@ void YAPQuery::close() {
RECOVER_MACHINE_REGS();
return;
}
YAP_LeaveGoal(FALSE, &q_h);
YAP_LeaveGoal(false, &q_h);
q_open = 0;
Yap_CloseHandles(q_handles);
// LOCAL_execution = this;