Print line numbers in stack traces, if we know them.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3090 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2008-12-06 02:08:07 +00:00
parent 90c028c812
commit b4defb722a
1 changed files with 7 additions and 1 deletions

View File

@ -96,6 +96,7 @@ void PR_StackTrace (progfuncs_t *progfuncs)
#endif
pr_stack[pr_depth].f = pr_xfunction;
pr_stack[pr_depth].s = pr_xstatement;
for (i=pr_depth ; i>0 ; i--)
{
f = pr_stack[i].f;
@ -115,7 +116,12 @@ void PR_StackTrace (progfuncs_t *progfuncs)
if (!f->s_file)
printf ("stripped : %s\n", f->s_name+progfuncs->stringtable);
else
printf ("%12s : %s\n", f->s_file+progfuncs->stringtable, f->s_name+progfuncs->stringtable);
{
if (pr_progstate[progs].linenums)
printf ("%12s %i : %s\n", f->s_file+progfuncs->stringtable, pr_progstate[progs].linenums[pr_stack[i].s], f->s_name+progfuncs->stringtable);
else
printf ("%12s : %s\n", f->s_file+progfuncs->stringtable, f->s_name+progfuncs->stringtable);
}
#ifdef STACKTRACE