How to install GDB with Python support on Windows

2019-04-28 04:12发布

I need to debug cython code. Official documentation says, I need to install "gdb 7.2 or higher, built with Python support". Unfortunately I didn't find any step-by-step guide how to install it on Windows 7. Do I have to build it myself (how?) or there already exists an installer for Windows 7, 64 bit? Any help would be greatly appreciated.

I use Windows 7, Python 2.7 64bit and Visual Studio 2008.

Also suggestions about alternative ways to debug cython (especially concerning non-console visual debuggers) are welcome. Thanks in advance for your help!

1条回答
在下西门庆
2楼-- · 2019-04-28 04:33

As with all GNU projects, GDB is provided as source code. The good news is that this means it can be built to run on practically any platform. The bad news is that, unless someone has already figured the process out for you, you have to do it yourself. GDB will be provided built-in on virtually any Linux distribution, but with Windows you're on your own.

You basically have three options:

  1. Move development (or at least debugging) over to Linux. This isn't as hard as it sounds. You can easily run Linux within a virtual machine inside Windows using VirtualBox, which is free software under GPL.

  2. Do debugging using a Cygwin shell inside windows. Cygwin is free under the GPL and allows you to run a Linux-like environment in Windows. It includes most of the GNU software, including the latest release of GDB.

  3. If you're feeling particularily adventurous, you could try to compile GDB yourself to work on your Windows system. This is by far the hardest route, and only for someone familiar with programming on Windows platforms.

In the end, I would strongly recommend using Linux for any serious Python development, especially when using Python extensions that do not have large developer communities.

查看更多
登录 后发表回答