GDB on Windows

From OHRRPGCE-Wiki

Jump to: navigation, 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.

Contents

[edit] getting a debug build of the OHRRPGCE

The latest debug build of the OHRRPGCE is available here: ohrrpgce-wip-fb-sdl-debug.zip. It runs a bit slower than the regular build, but when used together with gdb, it can provide useful information about crashes.

[edit] Installing gdb

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 gdb installer here Image:Gdb-download.png

Then run the installer, and it will install gdb.

[edit] Starting gdb

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 game.exe

Or you can create a batch file with the same command in it.

[edit] Using gdb

To start playing your game, type run

If your game crashes, type backtrace to get useful information that you can can paste into a bug report

When finished, type quit

Type help for a list of the many other commands.

[edit] Error Messages

If gdb says:

No executable specified, use `target exec'.

That means it wasn't able to find your copy of game.exe. This might mean that you need to put the full-path in your batch file, like this:

c:\mingw\bin\gdb.exe c:\ohrrpgce\game.exe

or maybe

c:\mingw\bin\gdb.exe "c:\Documents and Settings\My User Name\Desktop\OHRRPGCE\game.exe"

You can also just type something like at the (gdb) prompt:

target exec c:\ohrrpgce\game.exe

[edit] See Also

Personal tools