diff options
author | Guido van Rossum <guido@python.org> | 1992-09-03 20:29:45 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1992-09-03 20:29:45 (GMT) |
commit | 99bec95482db5a395f450c972e5d947af42a01fd (patch) | |
tree | 3026abb17a54e8a4708a26a67b1559721e8b163f /Python/ceval.c | |
parent | 59bff399a08b29b93b9d87c422f7077fc75c2a2a (diff) | |
download | cpython-99bec95482db5a395f450c972e5d947af42a01fd.zip cpython-99bec95482db5a395f450c972e5d947af42a01fd.tar.gz cpython-99bec95482db5a395f450c972e5d947af42a01fd.tar.bz2 |
Add some debugging features if DEBUG defined
(fetch the filename as a string so I can see it with dbx, and set f_lineno);
call abort() when detecting an "undetected" error.
Diffstat (limited to 'Python/ceval.c')
-rw-r--r-- | Python/ceval.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index 72f5eb1..469068e 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -180,6 +180,10 @@ eval_code(co, globals, locals, arg) #ifdef LLTRACE int lltrace = dictlookup(globals, "__lltrace__") != NULL; #endif +#ifdef DEBUG + /* Make it easier to find out where we are with dbx */ + char *filename = getstringvalue(co->co_filename); +#endif /* Code access macros */ @@ -296,6 +300,10 @@ eval_code(co, globals, locals, arg) } /* Extract opcode and argument */ + +#ifdef DEBUG + f->f_lasti = INSTR_OFFSET(); +#endif opcode = NEXTOP(); if (HAS_ARG(opcode)) @@ -1137,6 +1145,8 @@ eval_code(co, globals, locals, arg) else { if (err_occurred()) { fprintf(stderr, "XXX undetected error\n"); + abort(); + /* NOTREACHED */ why = WHY_EXCEPTION; } } |