Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…ithout debug symbols
  • Loading branch information...
commit c8376239fb3288d6fdb02a7c6e2b15c6211caf6f 1 parent 45e1605
@markflorisson markflorisson authored
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()
Please sign in to comment.
Something went wrong with that request. Please try again.