Closed silviot closed 10 years ago
The main problem here is that gdb doesn't start python as a subprocess, but links against libpython*.so
and embeds the interpreter. The --command
flag doesn't allow you to choose your preferred python interpreter, so this commit doesn't help; in fact, since --command
expects a file path for a file to execute (gdb will decide by itself what to do with that file), this breaks the debugger.
If you'll take a look at #16, you'll see you're not the first one to run into this problem (Ubuntu is the only distro I know of that links gdb against libpython3.*.so
). You can try getting around this by attempting to use LD_PRELOAD
to preload libpython2.7.so
, but my own attempts to get this to work didn't prove fruitful (using Ubuntu packages on an Arch install, so YMMV).
Thanks for the explanation! I was missing quite a part of the picture.
Without this change I'm getting this on a system that has also python3 installed, when I try to attach() to a process:
Curiosly enough
/usr/bin/env python
gives a python 2.7, but still gdb would try to run py3k. This change does not make pyringe work for me: I still have a consistent TimeoutError. But IMO it should not hurt.