Skip to content
Browse files

Print warning if cygdb reads debug info and is using an interpreter w…

…ithout debug symbols
  • Loading branch information...
1 parent 45e1605 commit c8376239fb3288d6fdb02a7c6e2b15c6211caf6f @markflorisson markflorisson committed Dec 3, 2010
Showing with 12 additions and 0 deletions.
  1. +12 −0 Cython/Debugger/Cygdb.py
View
12 Cython/Debugger/Cygdb.py
@@ -15,6 +15,7 @@
import sys
import glob
import tempfile
+import textwrap
import subprocess
usage = "Usage: cygdb [PATH [GDB_ARGUMENTS]]"
@@ -46,6 +47,17 @@ def make_command_file(path_to_debug_info, prefix_code='', no_import=False):
interpreter = open(path).read()
f.write("file %s\n" % interpreter)
f.write('\n'.join('cy import %s\n' % fn for fn in debug_files))
+ f.write(textwrap.dedent('''\
+ python
+ import sys
+ try:
+ gdb.lookup_type('PyModuleObject')
+ except RuntimeError:
+ sys.stderr.write(
+ 'Python was not compiled with debug symbols (or it was '
+ 'stripped). Some functionality may not work (properly).\\n')
+ end
+ '''))
f.close()

0 comments on commit c837623

Please sign in to comment.
Something went wrong with that request. Please try again.