GDB 5.1 for mingw

This is a set of patches to port the GNU debugger gdb-5.1 to the mingw environment. Due to space limitations, I can't host compiled executable file and full source here, you can only get the patches below. Please note that unlinke cygwin's GDB this one has no GUI, it's command line only.

Instructions for building

I assume that you will build on Linux. I've also built mingw-gdb on cygwin, but that was more troublesome, and build process ran terribly slow compared to Linux on the same machine.

  1. First you need, of course, to set up cross-compiling environment for mingw target (if you don't know how, read this page, for a start). I have gcc-2.95-320011106, binutils-2.11.92-20011113, mingw-runtime-1.1 and w32api-1.1. Note that you will need to have binutils executables prefixed with target-alias (i586-mingw-{ar,dlltool,ld,nm,ranlib}) somewhere on your PATH, otherwise linking of libtoolized libraries (bfd,opcodes) may fail.

  2. Obtain and unpack gdb-5.1.1 release.

  3. Apply these patches:

  4. CC=i586-mingw32-gcc ./configure --host=i586-mingw32 --target=i586-mingw32 --build=i686-pc-linux-gnu
    make prefix=whatever install
    here you have it.

Comments, suggestions are welcome:

I used Michael Rickmann's port of gdb-4.18 as excellent starting point.
Many thanks to Jose Fonseca for his extensive collection of software ported to mingw.
Other links of interest: