Chapter 10
Debugging your programs

Free Pascal supports debug information for the gnu debugger gdb, or its derivatives Insight on win32 or ddd on linux. It can write 2 kinds of debug information:

stabs

The old debug information format.

dwarf

The new debug information format.

Both are understood by GDB.

This chapter briefly describes how to use this feature. It doesn’t attempt to describe completely the gnu debugger, however. For more information on the workings of the gnu debugger, see the GDB User Manual.

Free Pascal also supports gprof, the gnu profiler. See section 10.4 for more information on profiling.

10.1 Compiling your program with debugger support
10.2 Using gdb to debug your program
10.3 Caveats when debugging with gdb
10.4 Support for gprof, the gnu profiler
10.5 Detecting heap memory leaks
10.6 Line numbers in run-time error backtraces
10.7 Combining heaptrc and lineinfo