From 8b558d1af77cb36c6c01962f51fbe464c7d69574 Mon Sep 17 00:00:00 2001 From: Mark Florisson Date: Thu, 4 Nov 2010 11:16:03 +0100 Subject: [PATCH] Fixed writing debug information with the --cplus flag --- Cython/Compiler/Main.py | 2 +- Cython/Compiler/ParseTreeTransforms.py | 5 +++-- Cython/Debugger/DebugWriter.py | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Cython/Compiler/Main.py b/Cython/Compiler/Main.py index 75a80414..4b1ecd03 100644 --- a/Cython/Compiler/Main.py +++ b/Cython/Compiler/Main.py @@ -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 = [] diff --git a/Cython/Compiler/ParseTreeTransforms.py b/Cython/Compiler/ParseTreeTransforms.py index 56807e51..67bdf9c4 100644 --- a/Cython/Compiler/ParseTreeTransforms.py +++ b/Cython/Compiler/ParseTreeTransforms.py @@ -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 diff --git a/Cython/Debugger/DebugWriter.py b/Cython/Debugger/DebugWriter.py index 6ec0fab4..32e57fb0 100644 --- a/Cython/Debugger/DebugWriter.py +++ b/Cython/Debugger/DebugWriter.py @@ -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) -- 2.26.2