[pypy-svn] r7448 - pypy/trunk/src/pypy/translator

bob at codespeak.net bob at codespeak.net
Fri Nov 19 16:11:07 CET 2004


Author: bob
Date: Fri Nov 19 16:11:06 2004
New Revision: 7448

Modified:
   pypy/trunk/src/pypy/translator/genc.h
   pypy/trunk/src/pypy/translator/genc.py
Log:
record the function name that OP_SIMPLE_CALL was used from



Modified: pypy/trunk/src/pypy/translator/genc.h
==============================================================================
--- pypy/trunk/src/pypy/translator/genc.h	(original)
+++ pypy/trunk/src/pypy/translator/genc.h	Fri Nov 19 16:11:06 2004
@@ -10,6 +10,7 @@
 /* Turn this off if you don't want the call trace frames to be built */
 #define USE_CALL_TRACE
 #define OBNOXIOUS_PRINT_STATEMENTS
+#define INSIDE_FUNCTION "<unknown>"
 
 #define op_richcmp(x,y,r,err,dir)   \
                        if (!(r=PyObject_RichCompare(x,y,dir))) goto err;
@@ -193,7 +194,7 @@
 #if defined(USE_CALL_TRACE)
 
 #define OP_SIMPLE_CALL(args, r, err) do { \
-	PyCodeObject *c = getcode("OP_SIMPLE_CALL" #args, __LINE__); \
+	PyCodeObject *c = getcode(INSIDE_FUNCTION " OP_SIMPLE_CALL" #args, __LINE__); \
 	PyThreadState *tstate = PyThreadState_GET(); \
 	PyFrameObject *f; \
 	if (c == NULL) { \

Modified: pypy/trunk/src/pypy/translator/genc.py
==============================================================================
--- pypy/trunk/src/pypy/translator/genc.py	(original)
+++ pypy/trunk/src/pypy/translator/genc.py	Fri Nov 19 16:11:06 2004
@@ -383,6 +383,8 @@
         print >> f, 'static PyObject* %s(PyObject* self, PyObject* args)' % (
             f_name,)
         print >> f, '{'
+        print >> f, '#undef INSIDE_FUNCTION'
+        print >> f, '#define INSIDE_FUNCTION "%s"' % (f_name,)
 
         # collect and print all the local variables
         graph = self.translator.getflowgraph(func)
@@ -448,6 +450,8 @@
             else:
                 fmt = '%s\n'
             f.write(fmt % line)
+        print >> f, '#undef INSIDE_FUNCTION'
+        print >> f, '#define INSIDE_FUNCTION "unknown"'
         print >> f, '}'
 
         # print the PyMethodDef



More information about the Pypy-commit mailing list