[Python-Dev] Debugging Python scripts with GDB on OSX
R. David Murray
rdmurray at bitdance.com
Thu Jul 7 13:01:17 EDT 2016
On Wed, 06 Jul 2016 16:14:34 -0000, Alexandru Croitor <alexandru.croitor at qt.io> wrote:
> I'm interested to find out if debugging Python scripts with GDB is supported on OSX at all?
> I'm referring to the functionality described on https://wiki.python.org/moin/DebuggingWithGdb and on http://fedoraproject.org/wiki/Features/EasierPythonDebugging.
> I've tried so far various combinations of pre-compiled GDB from the homebrew package manager, locally-compiled GDB from homebrew, as well as locally compiled GDB from MacPorts, together with a pre-compiled Python 2.7, homebrew-compiled 2.7, and custom compiled Python 2.7 from the official source tarball.
> My results so far were not successful. The legacy GDB commands to show a python stack trace or the local variables - do not work. And the new GDB commands (referenced on the Fedora project page) are not present at all in any of the GDB versions.
> I've checked the python CI build bot tests, and it seems the new GDB commands are only successfully tested on Linux machines, and are skipped on FreeBSD, OS X, and Solaris machines.
> Are the new python <-> GDB commands specific to Linux?
> Are there any considerations to take in regards to debug symbols for Python / GDB on OSX?
> Has anyone attempted what I'm trying to do?
> I would be grateful for any advice.
> And I apologize if my choice of the mailing lists is not the best.
I tried to do this a few weeks ago myself, with similar negative
results. The only thing I tried that you don't mention (I didn't
try everything you did) is a compile from raw gdb source...and that
didn't support OSX format core dumps. So I gave up.
More information about the Python-Dev