use DebugPlWrite for debugging writes

This commit is contained in:
Vitor Santos Costa
2009-05-22 13:23:51 -05:00
parent 328e2f5c22
commit e1421f207e
2 changed files with 34 additions and 34 deletions

View File

@@ -117,14 +117,14 @@ DumpActiveGoals (void)
if (first++ == 1)
fprintf(stderr,"Active ancestors:\n");
if (pe->ModuleOfPred) mod = pe->ModuleOfPred;
Yap_plwrite (mod, Yap_DebugPutc, 0);
Yap_DebugPlWrite (mod);
Yap_DebugPutc (Yap_c_error_stream,':');
if (pe->ArityOfPE == 0) {
Yap_plwrite (MkAtomTerm ((Atom)f), Yap_DebugPutc, 0);
Yap_DebugPlWrite (MkAtomTerm ((Atom)f));
} else {
Yap_plwrite (MkAtomTerm (NameOfFunctor (f)), Yap_DebugPutc, 0);
Yap_DebugPlWrite (MkAtomTerm (NameOfFunctor (f)));
Yap_DebugPutc (Yap_c_error_stream,'/');
Yap_plwrite (MkIntTerm (ArityOfFunctor (f)), Yap_DebugPutc, 0);
Yap_DebugPlWrite (MkIntTerm (ArityOfFunctor (f)));
}
Yap_DebugPutc (Yap_c_error_stream,'\n');
} else {
@@ -151,18 +151,18 @@ DumpActiveGoals (void)
if (pe->ModuleOfPred)
mod = pe->ModuleOfPred;
else mod = TermProlog;
Yap_plwrite (mod, Yap_DebugPutc, 0);
Yap_DebugPlWrite (mod);
Yap_DebugPutc (Yap_c_error_stream,':');
if (pe->ArityOfPE == 0) {
Yap_plwrite (MkAtomTerm (NameOfFunctor(f)), Yap_DebugPutc, 0);
Yap_DebugPlWrite (MkAtomTerm (NameOfFunctor(f)));
} else {
Int i = 0, arity = pe->ArityOfPE;
Term *args = &(b_ptr->cp_a1);
Yap_plwrite (MkAtomTerm (NameOfFunctor (f)), Yap_DebugPutc, 0);
Yap_DebugPlWrite (MkAtomTerm (NameOfFunctor (f)));
Yap_DebugPutc (Yap_c_error_stream,'(');
for (i= 0; i < arity; i++) {
if (i > 0) Yap_DebugPutc (Yap_c_error_stream,',');
Yap_plwrite(args[i], Yap_DebugPutc, Handle_vars_f);
Yap_DebugPlWrite(args[i]);
}
Yap_DebugPutc (Yap_c_error_stream,')');
}