From 14ce7707140d16270064ec1bcf5989173df669b9 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Thu, 28 Jun 2001 23:58:01 +0000 Subject: [PATCH] report statment addresses for current statement and branch destinations when printing statements --- libs/gamecode/pr_exec.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libs/gamecode/pr_exec.c b/libs/gamecode/pr_exec.c index 351bc56e3..c706b090e 100644 --- a/libs/gamecode/pr_exec.c +++ b/libs/gamecode/pr_exec.c @@ -149,7 +149,9 @@ void PR_PrintStatement (progs_t * pr, dstatement_t *s) { int i; + int addr = s - pr->pr_statements; + Con_Printf ("%-7d ", addr); if ((unsigned int) s->op < sizeof (pr_opnames) / sizeof (pr_opnames[0])) { Con_Printf ("%s ", pr_opnames[s->op]); i = strlen (pr_opnames[s->op]); @@ -158,10 +160,11 @@ PR_PrintStatement (progs_t * pr, dstatement_t *s) } if (s->op == OP_IF || s->op == OP_IFNOT) - Con_Printf ("%sbranch %i", PR_GlobalString (pr, (unsigned short) s->a), - s->b); + Con_Printf ("%sbranch %i (%i)", + PR_GlobalString (pr, (unsigned short) s->a), s->b, + addr + s->b); else if (s->op == OP_GOTO) { - Con_Printf ("branch %i", s->a); + Con_Printf ("branch %i (%i)", s->a, addr + s->a); } else if ((unsigned int) (s->op - OP_STORE_F) < 6) { Con_Printf ("%s", PR_GlobalString (pr, (unsigned short) s->a)); Con_Printf ("%s",