python-cysignals/python-cysignals-gdb.patch

27 lines
976 B
Diff
Raw Normal View History

2017-05-02 12:33:42 +00:00
--- src/scripts/cysignals-CSI.orig 2016-11-08 07:06:48.000000000 -0700
+++ src/scripts/cysignals-CSI 2017-04-03 15:38:46.018841319 -0600
@@ -67,6 +67,7 @@ def gdb_commands(pid, color):
cmds = b('')
cmds += b('set prompt (cysignals-gdb-prompt)\n')
cmds += b('set verbose off\n')
+ cmds += b('set auto-load safe-path /\n')
cmds += b('attach {0}\n'.format(pid))
cmds += b('python\n')
cmds += b('print("\\n")\n')
@@ -93,15 +94,7 @@ def run_gdb(pid, color):
"""
Execute gdb.
"""
- # Preload the right Python library
- libpython = os.path.join(sysconfig.get_config_var('exec_prefix'), 'lib',
- sysconfig.get_config_var('INSTSONAME'))
env = dict(os.environ)
- if sys.platform == 'macosx':
- env['DYLD_INSERT_LIBRARIES'] = libpython
- else:
- env['LD_PRELOAD'] = libpython
-
PIPE = subprocess.PIPE
try:
cmd = subprocess.Popen('gdb', stdin=PIPE, stdout=PIPE,