Support breaking on line numbers in the current Cython module (using ':linenumber...
authorMark Florisson <markflorisson88@gmail.com>
Sun, 7 Nov 2010 20:31:45 +0000 (21:31 +0100)
committerMark Florisson <markflorisson88@gmail.com>
Sun, 7 Nov 2010 20:31:45 +0000 (21:31 +0100)
Default sys.executable as the python interpreter for the debuggee

Cython/Debugger/Cygdb.py
Cython/Debugger/libcython.py

index 4c83c2c0daadf5324a65fcb6d3169823fde6faf4..09906675d2629c147861d4fa30a82ce6bee5e462 100644 (file)
@@ -36,6 +36,7 @@ def make_command_file(path_to_debug_info, prefix_code='', no_import=False):
     f.write(prefix_code)
     f.write('set breakpoint pending on\n')
     f.write("set print pretty on\n")
+    f.write("file %s\n" % sys.executable)
     f.write('python from Cython.Debugger import libcython\n')
     if not no_import:
         f.write('\n'.join('cy import %s\n' % fn for fn in debug_files))
index ecee05ad31eb8ba1f0a978c8db18a793b0b3fc23..c0558dacc4e472ee7455a5989109e87940dffe7d 100644 (file)
@@ -721,7 +721,11 @@ class CyBreak(CythonCommand):
     def _break_pyx(self, name):
         modulename, _, lineno = name.partition(':')
         lineno = int(lineno)
-        cython_module = self.cy.cython_namespace[modulename]
+        if modulename:
+            cython_module = self.cy.cython_namespace[modulename]
+        else:
+            cython_module = self.get_cython_function().module
+
         if lineno in cython_module.lineno_cy2c:
             c_lineno = cython_module.lineno_cy2c[lineno]
             breakpoint = '%s:%s' % (cython_module.c_filename, c_lineno)