avoid using Debug only constructs.
This commit is contained in:
parent
f133ff279e
commit
1b2f2f0f93
58
C/stack.c
58
C/stack.c
@ -31,6 +31,7 @@
|
|||||||
#include "Yap.h"
|
#include "Yap.h"
|
||||||
#include "clause.h"
|
#include "clause.h"
|
||||||
#include "yapio.h"
|
#include "yapio.h"
|
||||||
|
#include "iopreds.h"
|
||||||
#include "eval.h"
|
#include "eval.h"
|
||||||
#include "tracer.h"
|
#include "tracer.h"
|
||||||
#ifdef YAPOR
|
#ifdef YAPOR
|
||||||
@ -1763,8 +1764,13 @@ void DumpActiveGoals(USES_REGS1) {
|
|||||||
goto next;
|
goto next;
|
||||||
if (first++ == 1)
|
if (first++ == 1)
|
||||||
fprintf(stderr, "Active ancestors:\n");
|
fprintf(stderr, "Active ancestors:\n");
|
||||||
Yap_DebugWriteIndicator(pe);
|
Term mod = pe->ModuleOfPred;
|
||||||
Yap_DebugPutc(stderr, '\n');
|
if (mod == PROLOG_MODULE)
|
||||||
|
mod = TermProlog;
|
||||||
|
Term t = Yap_MkNewApplTerm(f, pe->ArityOfPE);
|
||||||
|
Yap_plwrite(Yap_PredicateIndicator(t,mod),GLOBAL_Stream+2, 0, 0, 1200);
|
||||||
|
|
||||||
|
fputc( '\n', stderr );
|
||||||
} else {
|
} else {
|
||||||
UNLOCK(pe->PELock);
|
UNLOCK(pe->PELock);
|
||||||
}
|
}
|
||||||
@ -1792,60 +1798,60 @@ void DumpActiveGoals(USES_REGS1) {
|
|||||||
else
|
else
|
||||||
mod = TermProlog;
|
mod = TermProlog;
|
||||||
if (mod != TermProlog && mod != MkAtomTerm(AtomUser)) {
|
if (mod != TermProlog && mod != MkAtomTerm(AtomUser)) {
|
||||||
Yap_DebugPlWrite(mod);
|
Yap_plwrite(mod,GLOBAL_Stream+2, 0, 0, 1200);
|
||||||
Yap_DebugPutc(stderr, ':');
|
fputc( ':', stderr );
|
||||||
}
|
}
|
||||||
if (mod == IDB_MODULE) {
|
if (mod == IDB_MODULE) {
|
||||||
if (pe->PredFlags & NumberDBPredFlag) {
|
if (pe->PredFlags & NumberDBPredFlag) {
|
||||||
Int id = pe->src.IndxId;
|
Int id = pe->src.IndxId;
|
||||||
Yap_DebugPlWrite(MkIntegerTerm(id));
|
Yap_plwrite(MkIntegerTerm(id),GLOBAL_Stream+2, 0, 0, 1200);
|
||||||
} else if (pe->PredFlags & AtomDBPredFlag) {
|
} else if (pe->PredFlags & AtomDBPredFlag) {
|
||||||
Atom At = (Atom)pe->FunctorOfPred;
|
Atom At = (Atom)pe->FunctorOfPred;
|
||||||
Yap_DebugPlWrite(MkAtomTerm(At));
|
Yap_plwrite(MkAtomTerm(At),GLOBAL_Stream+2, 0, 0, 1200);
|
||||||
} else {
|
} else {
|
||||||
Functor f = pe->FunctorOfPred;
|
Functor f = pe->FunctorOfPred;
|
||||||
Atom At = NameOfFunctor(f);
|
Atom At = NameOfFunctor(f);
|
||||||
arity_t arity = ArityOfFunctor(f);
|
arity_t arity = ArityOfFunctor(f);
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
Yap_DebugPlWrite(MkAtomTerm(At));
|
Yap_plwrite(MkAtomTerm(At),GLOBAL_Stream+2, 0, 0, 1200);
|
||||||
Yap_DebugPutc(stderr, '(');
|
fputc( '(', stderr );
|
||||||
for (i = 0; i < arity; i++) {
|
for (i = 0; i < arity; i++) {
|
||||||
if (i > 0)
|
if (i > 0)
|
||||||
Yap_DebugPutc(stderr, ',');
|
fputc( ',', stderr );
|
||||||
Yap_DebugPutc(stderr, '_');
|
fputc( '_', stderr );
|
||||||
}
|
}
|
||||||
Yap_DebugPutc(stderr, ')');
|
fputc( ')', stderr );
|
||||||
}
|
}
|
||||||
Yap_DebugPutc(stderr, '(');
|
fputc( '(', stderr );
|
||||||
Yap_DebugPlWrite(b_ptr->cp_a2);
|
Yap_plwrite(b_ptr->cp_a2,GLOBAL_Stream+2, 0, 0, 1200);
|
||||||
Yap_DebugPutc(stderr, ')');
|
fputc( ')', stderr );
|
||||||
} else if (pe->ArityOfPE == 0) {
|
} else if (pe->ArityOfPE == 0) {
|
||||||
Yap_DebugPlWrite(MkAtomTerm((Atom)f));
|
Yap_plwrite(MkAtomTerm((Atom)f),GLOBAL_Stream+2, 0, 0, 1200);
|
||||||
} else {
|
} else {
|
||||||
Int i = 0, arity = pe->ArityOfPE;
|
Int i = 0, arity = pe->ArityOfPE;
|
||||||
if (opnum == _or_last || opnum == _or_else) {
|
if (opnum == _or_last || opnum == _or_else) {
|
||||||
Yap_DebugPlWrite(MkAtomTerm(NameOfFunctor(f)));
|
Yap_plwrite(MkAtomTerm(NameOfFunctor(f)),GLOBAL_Stream+2, 0, 0, 1200);
|
||||||
Yap_DebugPutc(stderr, '(');
|
fputc( '(', stderr );
|
||||||
for (i = 0; i < arity; i++) {
|
for (i = 0; i < arity; i++) {
|
||||||
if (i > 0)
|
if (i > 0)
|
||||||
Yap_DebugPutc(stderr, ',');
|
fputc( ',', stderr );
|
||||||
Yap_DebugPutc(stderr, '_');
|
fputc( '_', stderr );
|
||||||
}
|
}
|
||||||
Yap_DebugErrorPuts(") :- ... ( _ ; _ ");
|
fputs(") :- ... ( _ ; _ ", stderr);
|
||||||
} else {
|
} else {
|
||||||
Term *args = &(b_ptr->cp_a1);
|
Term *args = &(b_ptr->cp_a1);
|
||||||
Yap_DebugPlWrite(MkAtomTerm(NameOfFunctor(f)));
|
Yap_plwrite(MkAtomTerm(NameOfFunctor(f)),GLOBAL_Stream+2, 0, 0, 1200);
|
||||||
Yap_DebugPutc(stderr, '(');
|
fputc( '(', stderr );
|
||||||
for (i = 0; i < arity; i++) {
|
for (i = 0; i < arity; i++) {
|
||||||
if (i > 0)
|
if (i > 0)
|
||||||
Yap_DebugPutc(stderr, ',');
|
fputc( ',', stderr );
|
||||||
Yap_DebugPlWrite(args[i]);
|
Yap_plwrite(args[i],GLOBAL_Stream+2, 0, 0, 1200);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Yap_DebugPutc(stderr, ')');
|
fputc( ')', stderr );
|
||||||
}
|
}
|
||||||
Yap_DebugPutc(stderr, '\n');
|
fputc( '\n', stderr );
|
||||||
}
|
}
|
||||||
b_ptr = b_ptr->cp_b;
|
b_ptr = b_ptr->cp_b;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user