Fixed writing debug information with the --cplus flag
authorMark Florisson <markflorisson88@gmail.com>
Thu, 4 Nov 2010 10:16:03 +0000 (11:16 +0100)
committerMark Florisson <markflorisson88@gmail.com>
Thu, 4 Nov 2010 10:16:03 +0000 (11:16 +0100)
Cython/Compiler/Main.py
Cython/Compiler/ParseTreeTransforms.py
Cython/Debugger/DebugWriter.py

index 75a80414af859c39c06332999d63f2caddabfe7a..4b1ecd037543040bc4d7abe03bcef0fac007b924 100644 (file)
@@ -185,7 +185,7 @@ class Context(object):
             from ParseTreeTransforms import DebugTransform
             self.debug_outputwriter = DebugWriter.CythonDebugWriter(
                 options.output_dir)
-            debug_transform = [DebugTransform(self, options)]
+            debug_transform = [DebugTransform(self, options, result)]
         else:
             debug_transform = []
             
index 56807e5102e903296ccba28c01c0f58d66f82876..67bdf9c4926b46b929b4949ab57fb15f62bf7595 100644 (file)
@@ -1474,13 +1474,14 @@ class DebugTransform(CythonTransform):
     to enable debugging.
     """
     
-    def __init__(self, context, options):
+    def __init__(self, context, options, result):
         super(DebugTransform, self).__init__(context)
         self.visited = set()
         # our treebuilder and debug output writer 
         # (see Cython.Debugger.debug_output.CythonDebugWriter)
         self.tb = self.context.debug_outputwriter
-        self.c_output_file = options.output_file
+        #self.c_output_file = options.output_file 
+        self.c_output_file = result.c_file
         
         # tells visit_NameNode whether it should register step-into functions
         self.register_stepinto = False
index 6ec0fab4537981f2034999f96b3c0ecb5c89e5d7..32e57fb02300a0d4695731e3b695bc1b0902e0a8 100644 (file)
@@ -68,4 +68,4 @@ class CythonDebugWriter(object):
             kw['pretty_print'] = True
         
         fn = "cython_debug_info_" + self.module_name
-        et.write(os.path.join(self.output_dir, fn), encoding="UTF-8", **kw)
\ No newline at end of file
+        et.write(os.path.join(self.output_dir, fn), encoding="UTF-8", **kw)