put tracer.c back to normal.

This commit is contained in:
Vitor Santos Costa 2008-09-14 05:11:35 +01:00
parent f4100a8095
commit 473012316a

View File

@ -50,10 +50,14 @@ send_tracer_message(char *start, char *name, Int arity, char *mname, CELL *args)
int i; int i;
if (arity) { if (arity) {
if (args)
fprintf(Yap_stderr, "%s %s:%s(", start, mname, name); fprintf(Yap_stderr, "%s %s:%s(", start, mname, name);
else
fprintf(Yap_stderr, "%s %s:%s/%d", start, mname, name, arity);
} else { } else {
fprintf(Yap_stderr, "%s %s:%s", start, mname, name); fprintf(Yap_stderr, "%s %s:%s", start, mname, name);
} }
if (args) {
for (i= 0; i < arity; i++) { for (i= 0; i < arity; i++) {
if (i > 0) fprintf(Yap_stderr, ","); if (i > 0) fprintf(Yap_stderr, ",");
#if DEBUG #if DEBUG
@ -77,7 +81,8 @@ send_tracer_message(char *start, char *name, Int arity, char *mname, CELL *args)
#endif #endif
#endif #endif
} }
if (arity) fprintf(Yap_stderr, ")"); fprintf(Yap_stderr, ")");
}
} }
fprintf(Yap_stderr, "\n"); fprintf(Yap_stderr, "\n");
} }
@ -308,11 +313,13 @@ low_level_trace(yap_low_level_port port, PredEntry *pred, CELL *args)
send_tracer_message("FAIL ", NULL, 0, NULL, args); send_tracer_message("FAIL ", NULL, 0, NULL, args);
mname = RepAtom(AtomOfTerm(Yap_Module_Name(pred)))->StrOfAE; mname = RepAtom(AtomOfTerm(Yap_Module_Name(pred)))->StrOfAE;
arity = pred->ArityOfPE; arity = pred->ArityOfPE;
if (arity == 0) if (arity == 0) {
s = RepAtom((Atom)pred->FunctorOfPred)->StrOfAE; s = RepAtom((Atom)pred->FunctorOfPred)->StrOfAE;
else
s = RepAtom(NameOfFunctor((pred->FunctorOfPred)))->StrOfAE;
send_tracer_message("RETRY CONSUMER: ", s, 0, mname, NULL); send_tracer_message("RETRY CONSUMER: ", s, 0, mname, NULL);
} else {
s = RepAtom(NameOfFunctor((pred->FunctorOfPred)))->StrOfAE;
send_tracer_message("RETRY CONSUMER: ", s, pred->ArityOfPE, mname, NULL);
}
break; break;
case retry_table_loader: case retry_table_loader:
send_tracer_message("FAIL ", NULL, 0, NULL, args); send_tracer_message("FAIL ", NULL, 0, NULL, args);