Creating a Backtrace with GDB

From Free Pascal wiki
Revision as of 15:38, 23 February 2005 by AndrewH (talk | contribs) (Just started, not finished yet)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Reasons to create a backtrace

Bug Reports

Backtraces can be very helpfull when submitting bug reports. They will no doubt increase the chances of the bug getting fixed sooner.

Help yourself find a problem

A backtrace can really take the pain out of finding a problem with your own program. Often exposing the problem immediately.

Just plain fun!!

Okay this might be a stretch, but making backtraces is just plain fun!

Seriously though, if you can think of another reason to create a backtrace add it here.

Creating a Backtrace

To create a backtrace with gdb(gnu debugger):

  1. You must have the program gdb
  2. gdb must be in the PATH enviornment variable
  3. The program you wish to debug MUST have debugging info included in the executable. If you have used "strip", "upx", compiled with "TODO what are the fpc options to strip debugging info" or some other exe shrinker/compressor this won't work!

Windows Users:

  1. Open a MS-DOS prompt
  2. Change to the drive you have your exe on:
C: {press enter}
  1. Change to the directory containing the exe:
cd \myprograms\Project1 {press enter}
  1. Run the program using gdb:
gdb Project1.exe

Linux/BSD Users: