From: Mark Florisson Date: Fri, 3 Dec 2010 20:55:29 +0000 (+0100) Subject: Print warning if cygdb reads debug info and is using an interpreter without debug... X-Git-Tag: 0.14.beta0~1^2~3 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c8376239fb3288d6fdb02a7c6e2b15c6211caf6f;p=cython.git Print warning if cygdb reads debug info and is using an interpreter without debug symbols --- diff --git a/Cython/Debugger/Cygdb.py b/Cython/Debugger/Cygdb.py index 87b2c0f6..eefbdbe0 100644 --- a/Cython/Debugger/Cygdb.py +++ b/Cython/Debugger/Cygdb.py @@ -15,6 +15,7 @@ import os 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()