Commit b85f74fa authored by Mark Florisson's avatar Mark Florisson

Support breaking on line numbers in the current Cython module (using ':linenumber' syntax)

Default sys.executable as the python interpreter for the debuggee
parent dabdcf42
......@@ -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))
......
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment