I am trying to debug Python3 extensions with cygdb. Currently, whether I run
$ python2 `which cygdb` . -vv -- --args /usr/bin/python3 run.py
or
$ python3 `which cygdb` . -vv -- --args /usr/bin/python3 run.py
(where run.py is a file that invokes an intentionally crashing cython extension), calling `cy bt` at the gdb CLI results in the following error:
(gdb) cy bt
Python Exception <class 'gdb.error'> Cannot convert value to int.:
Error occurred in Python command: Cannot convert value to int.
Setting `python print-stack` to `full` shows that the error actually happens in the call to `PyObjectPtr.is_null` (in `Cython.Debugger.libpython`); `int` is called on an object of type `gdb.Value` (I cannot locate where this class is defined).
Note that at that point, regardless of the invocation of cygdb, the Python interpreter used by gdb is Python2.
Any help would be welcome.
This is on Arch Linux with gdb 7.9.1, python3 3.4.1, python2 2.7.10, cython{2,3} 0.23.
cross-posted to stackoverflow