GDB on Windows

From OHRRPGCE-Wiki
Jump to navigationJump to search

GDB is the GNU Debugger. It can be used to get information about crashes, including backtraces, which can be very helpful to the programmers when you report bugs.

getting a debug build of the OHRRPGCE[edit]

The latest debug build of the OHRRPGCE is available here: ohrrpgce-wip-directx-sdl-debug.zip. When used together with gdb, it can provide useful information about crashes.

Installing gdb[edit]

If you are using Linux, you probably already have gdb, but if you are using Windows, you will need to install it.

MinGW distributes a Windows version of gdb. You can get the latest mingw installer here which can in turn install gdb. After installing MinGW, run the "MinGW Installation Manager" (which for me was located in C:\MinGW\libexec\mingw-get\guimain.exe ) and then make sure that the mingw32-gdb bin package is installed. (These instructions are for mingw32, not the mingw-w64 fork. But gdb from mingw-w64 should work too.)

Starting gdb[edit]

gdb will not show up in your start menu. It is a command-line program. From a command-line prompt, you can type:

c:\mingw\bin\gdb.exe program_to_debug.exe

Or you can create a batch file with the same command in it. There is already a pair of pre-made batch files for debugging the OHRRPGCE.

C:\OHRRPGCE\gdbgame.bat
C:\OHRRPGCE\gdbcustom.bat

See Also[edit]