You need to build gdb. Per this answer , you need to set CFLAGS=-Wno-string-plus-int before creating (at least for MacOS 10.9 and gdb 7.6.1).
Before using it, you must codeign gdb .
Then you need to get the "real" executable from the MacOS binary, so gdb can read it:
lipo -thin x86_64 -output python-x86_64 /usr/bin/python
Then you can happily:
gdb --args /path/to/python-x86_64 myPythonScript.py arg1 arg2
Alternatively you can use lldb .
source share