Running cygdb with Cython installed in the system leads to the following problem:
vitja@vitja-laptop:~/work/cython-vitek-git/zzz$ python ../cygdb.py GNU gdb (GDB) 7.2-ubuntu Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Traceback (most recent call last): File "<string>", line 1, in <module> ImportError: No module named Debugger /tmp/tmp1ZvOf9:3: Error in sourced command file: Error while executing Python code. (gdb) So may be it's better to explicitly specify correct path to Cython package in gdb script? Small example patch is attached. -- vitja.
diff --git a/Cython/Debugger/Cygdb.py b/Cython/Debugger/Cygdb.py index faa98d7..bbb0de7 100644 --- a/Cython/Debugger/Cygdb.py +++ b/Cython/Debugger/Cygdb.py @@ -31,11 +31,15 @@ def make_command_file(path_to_debug_info, prefix_code='', no_import=False): sys.exit('%s.\nNo debug files were found in %s. Aborting.' % ( usage, os.path.abspath(path_to_debug_info))) + cython_root = os.path.abspath( + os.path.join(os.path.dirname(__file__),'../..')) + fd, tempfilename = tempfile.mkstemp() f = os.fdopen(fd, 'w') f.write(prefix_code) f.write('set breakpoint pending on\n') f.write("set print pretty on\n") + f.write("python import sys; sys.path.insert(0, %r)\n" % cython_root) f.write('python from Cython.Debugger import libcython, libpython\n') if no_import:
_______________________________________________ cython-devel mailing list cython-devel@python.org http://mail.python.org/mailman/listinfo/cython-devel