Adding gdb to MinGW

Solution 1:

In a command prompt I browsed to C:\MinGW\bin and ran:

mingw-get.exe install gdb

That fixed it for me. Not sure if it matters but I have C:\MinGW\bin in my path (guess I probably didn't need to browse to C:\MinGW\bin).

Solution 2:

The Current Release (5.2.1) version of gdb at the project files page has always worked for me. The download is a stand-alone .exe, you don't need anything else.

But I'll bet the .exe in the 6.8 package will work, too. I'd try using just the .exe, and then if there are problems, try extracting the other files from the 6.8 package. (Though that may cause problems with the rest of the MinGW installation.)

Update: There seems to be a 7.something version. I haven't tested it thoroughly, but it seems to work, even with gcc 3.

Solution 3:

Get Wascana Desktop Developer. It combines MinGW, gcc, Eclipse and gdb in one package.

Solution 4:

You can safely overwrite the files prepackaged with MinGW with the (newer) ones from the gdb tarball. You can also choose not to overwrite them - just make sure to pick either one set, i.e. avoid mixing files from the older and the newer package.

Most of the offending files are probably not really relevant to you anyway. For example, the files belonging to the libbfd library aren't required for gdb's day to day operation, they're used if you want to extend the debugger or write debugging tools yourself.

At any rate, make a backup of the mingw directory before untarring the new release. It's very easy since MinGW is self-contained in that directory. That way, if anything should malfunction, you can just delete the directory and restore from the backup.

Solution 5:

Usually for installing gdb in windows, You have to 2 ways to install:

1) use ready-made binaries that were build and compiled from GNU gdb by some provider (easy to install)

  • use TDM-GCC binaries provided from the following URL and that is including inturn the gcc complier and also gdb debugger. http://tdm-gcc.tdragon.net/
  • use Equation package inside which GNU GDB was already compiled and built. http://www.equation.com/servlet/equation.cmd?fa=gdb

2) use minimal mingw or cygwin package then after install gdb inside it.

  • Install either mingw or cygwin inside which GDB is already shipped
  • Open cygwin or mingw terminal and just type the following to make sure it is already installed

    $ gdb --version

    1. Hint: if you did not find gdb installed, simply open the cygwin or mingw package installer and make sure you already check gdb
    2. Hint: getting and installing a debug build of the OHRRPGCE is providing useful information about crashes.
  • From cygwin or mingw terminal, Start gdb using the following c:\mingw\bin\gdb.exe program_to_debug.exe

REF: http://rpg.hamsterrepublic.com/ohrrpgce/GDB_on_Windows