From c8376239fb3288d6fdb02a7c6e2b15c6211caf6f Mon Sep 17 00:00:00 2001 From: Mark Florisson Date: Fri, 3 Dec 2010 21:55:29 +0100 Subject: [PATCH] Print warning if cygdb reads debug info and is using an interpreter without debug symbols --- Cython/Debugger/Cygdb.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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() -- 2.26.2