stack info

This commit is contained in:
Vitor Santos Costa 2018-06-17 10:46:15 +01:00
parent 4fefb762f2
commit fd4f53a899

View File

@ -1808,7 +1808,7 @@ void Yap_dump_stack(void) {
yap_error_class_number classno = Yap_errorClass(errnb);
fprintf(stderr, "%% Error STATUS: %s/%s\n\n", Yap_errorName(errnb),
Yap_errorName(classno));
Yap_errorClassName(classno));
fprintf(stderr, "%% Execution mode\n");
if (LOCAL_PrologMode & BootMode)
@ -1846,7 +1846,7 @@ void Yap_dump_stack(void) {
if (LOCAL_PrologMode & SystemMode)
fprintf(stderr, "%% Prolog Internals\n");
if (LOCAL_PrologMode & AsyncIntMode)
fprintf(stderr, "%% Async Interruot mode\n");
fprintf(stderr, "%% Async Interrupt mode\n");
if (LOCAL_PrologMode & InReadlineMode)
fprintf(stderr, "%% Readline Console\n");
if (LOCAL_PrologMode & TopGoalMode)
@ -1854,8 +1854,7 @@ void Yap_dump_stack(void) {
fprintf(stderr, "%% \n%% -------------------------------------\n%%\n");
fprintf(stderr, "%% \n%% YAP Program :\n");
fprintf(stderr, "%% \n%% -------------------------------------\n%%\n");
fprintf(stderr, "%% Program Position\n\n", Yap_errorName(errno),
Yap_errorName(classno));
fprintf(stderr, "%% Program Position\n\n");
Yap_detect_bug_location(CP, FIND_PRED_FROM_ANYWHERE, 256);
fprintf(stderr, "%% PC: %s\n", (char *)HR);
Yap_detect_bug_location(CP, FIND_PRED_FROM_ANYWHERE, 256);
@ -1928,7 +1927,7 @@ void Yap_dump_stack(void) {
}
if (b_ptr) {
if (!max_count--) {
fprintf(stderr, "%%\** .....\n");
fprintf(stderr, "%% \\** .....\n");
return;
}
if (b_ptr->cp_ap && /* tabling */
@ -1947,6 +1946,7 @@ void Yap_dump_stack(void) {
}
}
void DumpActiveGoals(USES_REGS1) {
/* try to dump active goals */
CELL *ep = YENV; /* and current environment */
@ -2002,7 +2002,7 @@ void DumpActiveGoals(USES_REGS1) {
op_numbers opnum;
if (!ONLOCAL(b_ptr) || b_ptr->cp_b == NULL)
break;
fprintf(stderr, "%%p ", b_ptr);
fprintf(stderr, "%% %p ", b_ptr);
pe = Yap_PredForChoicePt(b_ptr, &opnum);
if (opnum == _Nstop) {
fprintf(stderr, " ********** C-Code Interface Boundary ***********\n");
@ -2090,15 +2090,15 @@ void Yap_detect_bug_location(yamop *yap_pc, int where_from, int psize) {
if ((cl = Yap_PredForCode(yap_pc, where_from, &pred_name, &pred_arity,
&pred_module)) == 0) {
/* system predicate */
fprintf(stderr, "%%s", "meta-call");
fprintf(stderr, "%% %s", "meta-call");
} else if (pred_module == 0) {
fprintf(stderr, "in prolog:%s/%lu", RepAtom(pred_name)->StrOfAE,
(unsigned long int)pred_arity);
} else if (cl < 0) {
fprintf(stderr, "%%s:%s/%lu", RepAtom(AtomOfTerm(pred_module))->StrOfAE,
fprintf(stderr, "%% %s:%s/%lu", RepAtom(AtomOfTerm(pred_module))->StrOfAE,
RepAtom(pred_name)->StrOfAE, (unsigned long int)pred_arity);
} else {
fprintf(stderr, "%%s:%s/%lu at clause %lu",
fprintf(stderr, "%% %s:%s/%lu at clause %lu",
RepAtom(AtomOfTerm(pred_module))->StrOfAE,
RepAtom(pred_name)->StrOfAE, (unsigned long int)pred_arity,
(unsigned long int)cl);