Debugging Go 1.2 on Ubuntu 13.10 with GDB

While the Debugging Go Code with GDB documentation is fantastic, it unfortunately doesn’t work out of the box with Ubuntu 13.10. If you try it you’ll probably see an error similar to:

The problem is that Ubuntu 13.10 links GDB against Python 3.3 while the script golang ships is for Python 2. Someone has already filed an issue, and it appears to be fixed upstream (so expect Go 1.3 to Just Work).

Luckily backporting the fix is easy. Simply move your existing runtime-gdb.py out of the way and download the upstream version in its place.