try to give line numbers in the traceback
This commit is contained in:
parent
a53dba93b2
commit
b6a3bc8d1c
|
@ -479,9 +479,32 @@ PR_StackTrace (progs_t * pr)
|
||||||
|
|
||||||
if (!f) {
|
if (!f) {
|
||||||
Sys_Printf ("<NO FUNCTION>\n");
|
Sys_Printf ("<NO FUNCTION>\n");
|
||||||
} else
|
} else {
|
||||||
Sys_Printf ("%12s : %s: %x\n", PR_GetString (pr, f->s_file),
|
if (pr_debug->int_val && pr->debug) {
|
||||||
PR_GetString (pr, f->s_name), pr->pr_stack[i].s);
|
pr_lineno_t *lineno = PR_Find_Lineno (pr, pr->pr_stack[i].s);
|
||||||
|
pr_auxfunction_t *func = PR_Get_Lineno_Func (pr, lineno);
|
||||||
|
unsigned int line = PR_Get_Lineno_Line (pr, lineno);
|
||||||
|
int addr = PR_Get_Lineno_Addr (pr, lineno);
|
||||||
|
|
||||||
|
line += func->source_line;
|
||||||
|
if (addr == pr->pr_stack[i].s) {
|
||||||
|
Sys_Printf ("%12s:%d : %s: %x\n",
|
||||||
|
PR_GetString (pr, f->s_file),
|
||||||
|
line,
|
||||||
|
PR_GetString (pr, f->s_name),
|
||||||
|
pr->pr_stack[i].s);
|
||||||
|
} else {
|
||||||
|
Sys_Printf ("%12s:%d+%d : %s: %x\n",
|
||||||
|
PR_GetString (pr, f->s_file),
|
||||||
|
line, pr->pr_stack[i].s - addr,
|
||||||
|
PR_GetString (pr, f->s_name),
|
||||||
|
pr->pr_stack[i].s);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Sys_Printf ("%12s : %s: %x\n", PR_GetString (pr, f->s_file),
|
||||||
|
PR_GetString (pr, f->s_name), pr->pr_stack[i].s);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue