diff Python/ceval.c @ 1016:a41e3ba5b47d legacy-trunk

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.
author Guido van Rossum <guido@python.org>
date Thu, 03 Sep 1992 20:29:45 +0000
parents c9c0328368a9
children 2c0432fcc270
line wrap: on
line diff
--- a/Python/ceval.c	Thu Sep 03 20:28:00 1992 +0000
+++ b/Python/ceval.c	Thu Sep 03 20:29:45 1992 +0000
@@ -180,6 +180,10 @@
 #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 @@
 		}
 
 		/* Extract opcode and argument */
+
+#ifdef DEBUG
+		f->f_lasti = INSTR_OFFSET();
+#endif
 		
 		opcode = NEXTOP();
 		if (HAS_ARG(opcode))
@@ -1137,6 +1145,8 @@
 		else {
 			if (err_occurred()) {
 				fprintf(stderr, "XXX undetected error\n");
+				abort();
+				/* NOTREACHED */
 				why = WHY_EXCEPTION;
 			}
 		}