Friendlier breakpoints.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@421 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2004-11-13 17:34:07 +00:00
parent 0ba312c9e3
commit 1212770986
4 changed files with 28 additions and 19 deletions

View File

@ -947,7 +947,7 @@ PR_RunError(progfuncs, "Extra opcode not implemented\n");
{ {
pr_xstatement = s = st-pr_statements; pr_xstatement = s = st-pr_statements;
printf("Break point hit.\n"); printf("Break point hit in %s.\n", pr_xfunction->s_name);
if (pr_trace<1) if (pr_trace<1)
pr_trace=1; //this is what it's for pr_trace=1; //this is what it's for

View File

@ -390,7 +390,10 @@ reeval:
NUM_FOR_EDICT(ed); // make sure it's in range NUM_FOR_EDICT(ed); // make sure it's in range
#endif #endif
if (ed->readonly) if (ed->readonly)
PR_RunError (progfuncs, "assignment to read-only entity"); {
pr_xstatement = st-pr_statements;
PR_RunError (progfuncs, "assignment to read-only entity in %s", pr_xfunction->s_name);
}
OPC->_int = (int)(((int *)edvars(ed)) + OPB->_int + progfuncs->fieldadjust); OPC->_int = (int)(((int *)edvars(ed)) + OPB->_int + progfuncs->fieldadjust);
break; break;
@ -424,7 +427,7 @@ reeval:
case OP_IFNOTS: case OP_IFNOTS:
RUNAWAYCHECK(); RUNAWAYCHECK();
if (!OPA->string || !*OPA->string) if (!OPA->string || !OPA->string[progfuncs->stringtable])
st += (sofs)st->b - 1; // offset the s++ st += (sofs)st->b - 1; // offset the s++
break; break;
@ -436,7 +439,7 @@ reeval:
case OP_IFS: case OP_IFS:
RUNAWAYCHECK(); RUNAWAYCHECK();
if (OPA->string && *OPA->string) if (OPA->string && OPA->string[progfuncs->stringtable])
st += (sofs)st->b - 1; // offset the s++ st += (sofs)st->b - 1; // offset the s++
break; break;
@ -484,10 +487,10 @@ reeval:
else else
pr_argc = st->op - OP_CALL0; pr_argc = st->op - OP_CALL0;
fnum = OPA->function; fnum = OPA->function;
if ((fnum & ~0xff000000)<=0) if ((fnum & ~0xff000000)==0)
{ {
pr_trace++; pr_trace++;
printf("NULL function from qc.\n"); printf("NULL function from qc (%s).\n", pr_xfunction->s_name);
#ifndef DEBUGABLE #ifndef DEBUGABLE
goto cont; goto cont;
#endif #endif
@ -944,7 +947,7 @@ PR_RunError(progfuncs, "Extra opcode not implemented\n");
{ {
pr_xstatement = s = st-pr_statements; pr_xstatement = s = st-pr_statements;
printf("Break point hit.\n"); printf("Break point hit in %s.\n", pr_xfunction->s_name);
if (pr_trace<1) if (pr_trace<1)
pr_trace=1; //this is what it's for pr_trace=1; //this is what it's for

View File

@ -390,7 +390,10 @@ reeval:
NUM_FOR_EDICT(ed); // make sure it's in range NUM_FOR_EDICT(ed); // make sure it's in range
#endif #endif
if (ed->readonly) if (ed->readonly)
PR_RunError (progfuncs, "assignment to read-only entity"); {
pr_xstatement = st-pr_statements;
PR_RunError (progfuncs, "assignment to read-only entity in %s", pr_xfunction->s_name);
}
OPC->_int = (int)(((int *)edvars(ed)) + OPB->_int + progfuncs->fieldadjust); OPC->_int = (int)(((int *)edvars(ed)) + OPB->_int + progfuncs->fieldadjust);
break; break;
@ -424,7 +427,7 @@ reeval:
case OP_IFNOTS: case OP_IFNOTS:
RUNAWAYCHECK(); RUNAWAYCHECK();
if (!OPA->string || !*OPA->string) if (!OPA->string || !OPA->string[progfuncs->stringtable])
st += (sofs)st->b - 1; // offset the s++ st += (sofs)st->b - 1; // offset the s++
break; break;
@ -436,7 +439,7 @@ reeval:
case OP_IFS: case OP_IFS:
RUNAWAYCHECK(); RUNAWAYCHECK();
if (OPA->string && *OPA->string) if (OPA->string && OPA->string[progfuncs->stringtable])
st += (sofs)st->b - 1; // offset the s++ st += (sofs)st->b - 1; // offset the s++
break; break;
@ -484,10 +487,10 @@ reeval:
else else
pr_argc = st->op - OP_CALL0; pr_argc = st->op - OP_CALL0;
fnum = OPA->function; fnum = OPA->function;
if ((fnum & ~0xff000000)<=0) if ((fnum & ~0xff000000)==0)
{ {
pr_trace++; pr_trace++;
printf("NULL function from qc.\n"); printf("NULL function from qc (%s).\n", pr_xfunction->s_name);
#ifndef DEBUGABLE #ifndef DEBUGABLE
goto cont; goto cont;
#endif #endif
@ -944,7 +947,7 @@ PR_RunError(progfuncs, "Extra opcode not implemented\n");
{ {
pr_xstatement = s = st-pr_statements; pr_xstatement = s = st-pr_statements;
printf("Break point hit.\n"); printf("Break point hit in %s.\n", pr_xfunction->s_name);
if (pr_trace<1) if (pr_trace<1)
pr_trace=1; //this is what it's for pr_trace=1; //this is what it's for

View File

@ -390,7 +390,10 @@ reeval:
NUM_FOR_EDICT(ed); // make sure it's in range NUM_FOR_EDICT(ed); // make sure it's in range
#endif #endif
if (ed->readonly) if (ed->readonly)
PR_RunError (progfuncs, "assignment to read-only entity"); {
pr_xstatement = st-pr_statements;
PR_RunError (progfuncs, "assignment to read-only entity in %s", pr_xfunction->s_name);
}
OPC->_int = (int)(((int *)edvars(ed)) + OPB->_int + progfuncs->fieldadjust); OPC->_int = (int)(((int *)edvars(ed)) + OPB->_int + progfuncs->fieldadjust);
break; break;
@ -424,7 +427,7 @@ reeval:
case OP_IFNOTS: case OP_IFNOTS:
RUNAWAYCHECK(); RUNAWAYCHECK();
if (!OPA->string || !*OPA->string) if (!OPA->string || !OPA->string[progfuncs->stringtable])
st += (sofs)st->b - 1; // offset the s++ st += (sofs)st->b - 1; // offset the s++
break; break;
@ -436,7 +439,7 @@ reeval:
case OP_IFS: case OP_IFS:
RUNAWAYCHECK(); RUNAWAYCHECK();
if (OPA->string && *OPA->string) if (OPA->string && OPA->string[progfuncs->stringtable])
st += (sofs)st->b - 1; // offset the s++ st += (sofs)st->b - 1; // offset the s++
break; break;
@ -484,10 +487,10 @@ reeval:
else else
pr_argc = st->op - OP_CALL0; pr_argc = st->op - OP_CALL0;
fnum = OPA->function; fnum = OPA->function;
if ((fnum & ~0xff000000)<=0) if ((fnum & ~0xff000000)==0)
{ {
pr_trace++; pr_trace++;
printf("NULL function from qc.\n"); printf("NULL function from qc (%s).\n", pr_xfunction->s_name);
#ifndef DEBUGABLE #ifndef DEBUGABLE
goto cont; goto cont;
#endif #endif
@ -944,7 +947,7 @@ PR_RunError(progfuncs, "Extra opcode not implemented\n");
{ {
pr_xstatement = s = st-pr_statements; pr_xstatement = s = st-pr_statements;
printf("Break point hit.\n"); printf("Break point hit in %s.\n", pr_xfunction->s_name);
if (pr_trace<1) if (pr_trace<1)
pr_trace=1; //this is what it's for pr_trace=1; //this is what it's for