Note: this post can be read as a series of terminal commands if you’re not interested in the intervening explanations.
Recently, I started writing a Python extension that wraps the procedural
generation library libnoise using
SIP-generated code, and
encountered the inevitable segfaults. It didn’t take long to establish that the
error was somewhere in my C++ code, but I couldn’t figure out where exactly it
was. A couple of searches online revealed that the way to go about finding these
things was to use a proper debugger, and because the GNU Debugger – `
supports Python, that seemed to be the way to go.
Getting it working was not, however, particularly straightforward.
supports debugging Python code as of version 7. Unfortunately, Apple’s version
gdb is currently sitting at 6.3. So all I had to do was get a newer
version, right? Wrong.