mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
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.
This commit is contained in:
parent
59bff399a0
commit
99bec95482
1 changed files with 10 additions and 0 deletions
|
@ -180,6 +180,10 @@ eval_code(co, globals, locals, arg)
|
||||||
#ifdef LLTRACE
|
#ifdef LLTRACE
|
||||||
int lltrace = dictlookup(globals, "__lltrace__") != NULL;
|
int lltrace = dictlookup(globals, "__lltrace__") != NULL;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef DEBUG
|
||||||
|
/* Make it easier to find out where we are with dbx */
|
||||||
|
char *filename = getstringvalue(co->co_filename);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Code access macros */
|
/* Code access macros */
|
||||||
|
|
||||||
|
@ -296,6 +300,10 @@ eval_code(co, globals, locals, arg)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Extract opcode and argument */
|
/* Extract opcode and argument */
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
f->f_lasti = INSTR_OFFSET();
|
||||||
|
#endif
|
||||||
|
|
||||||
opcode = NEXTOP();
|
opcode = NEXTOP();
|
||||||
if (HAS_ARG(opcode))
|
if (HAS_ARG(opcode))
|
||||||
|
@ -1137,6 +1145,8 @@ eval_code(co, globals, locals, arg)
|
||||||
else {
|
else {
|
||||||
if (err_occurred()) {
|
if (err_occurred()) {
|
||||||
fprintf(stderr, "XXX undetected error\n");
|
fprintf(stderr, "XXX undetected error\n");
|
||||||
|
abort();
|
||||||
|
/* NOTREACHED */
|
||||||
why = WHY_EXCEPTION;
|
why = WHY_EXCEPTION;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue