-
Notifications
You must be signed in to change notification settings - Fork 77
syntax error in libpython.py #22
Comments
As a first piece of information: Though you've correctly installed the pyringe package (i.e. you've installed it as a python2.7 package), as the README states, this isn't the only thing that must be in python2. I don't have a Ubuntu VM handy right now, but from looking at the current Ubuntu Trusty gdb 7.7.1 package I can tell it depends on libpython3.4, which means point To get pyringe to work on that Ubuntu release, you'll need to find a version of gdb that still uses libpython2.x. |
if I dont the version of the gdb which uses libpython2.x then should I need to use python3.x ? |
You can't use python3.x with pyringe either, since no part of it is written with python3 support in mind. Neither the part running in the local python process, nor the stubs running within gdb, nor the debugging library ( It's a shame, but it was only ever intended to debug python2 programs. If you can't find a suitable build of gdb, you're out of luck and can't use pyringe. :( |
is there any way to find a suitable gdb for that ?? |
You'll have to do that yourself. While the Ubuntu package listing usually lists dependencies for each package (you'll need one that depends on libpython2), I'm not sure whether they even list old versions of packages. I found this listing by googling, but I don't know which one's the latest that still links to libpython2. Godspeed. |
Thank you, let me try it. |
In case someone runs into this nowadays: Debian has a gdb-python2 package that is just gdb linked against python 2.7. On Ubuntu 16.04 I could install the jesse-backport version with dpkg and resolve dependencies afterwards by doing Good luck! |
If anyone finds this bug, and you want this to work with Python 2.7.15 then you should replace libpython.py in the source tree with the copy from https://github.com/python/cpython/blob/2.7/Tools/gdb/libpython.py (tested Ubuntu 18.04.3) |
I have installed pyringe in my Ubuntu 14.04 which has GDB 7.7.1. Everything installed fine but when start it and attach the process id I get the following error.
File "", line 1, in
File "/usr/local/lib/python2.7/dist-packages/pyringe/repl.py", line 161, in Attach
self.inferior.Reinit(pid)
File "/usr/local/lib/python2.7/dist-packages/pyringe/inferior.py", line 484, in Reinit
self.init(pid, auto_symfile_loading, architecture=self.arch)
File "/usr/local/lib/python2.7/dist-packages/pyringe/inferior.py", line 456, in init
self.StartGdb()
File "/usr/local/lib/python2.7/dist-packages/pyringe/inferior.py", line 503, in StartGdb
self._gdb.Attach(self.position)
File "/usr/local/lib/python2.7/dist-packages/pyringe/inferior.py", line 200, in
return lambda _args, *_kwargs: self._Execute(name, _args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/pyringe/inferior.py", line 342, in _Execute
result_string = self._Recv(timeout)
File "/usr/local/lib/python2.7/dist-packages/pyringe/inferior.py", line 427, in _Recv
raise ProxyError(exc_text)
ProxyError: Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pyringe/payload/gdb_service.py", line 34, in
*here it gives the syntax error **** in the libpython file
import libpython
File "/usr/local/lib/python2.7/dist-packages/pyringe/payload/libpython.py", line 58
Py_TPFLAGS_HEAPTYPE = (1L << 9)
Why am I getting that error ?
The text was updated successfully, but these errors were encountered: