Go to the first, previous, next, last section, table of contents.

Debugging

The command line option `-g' specifies generation of debugging information for GDB, the GNU debugger. GDB is not as comfortable as the Turbo Debugger, but it has the same abilities but one: The program being debugged is slowed down. For more information about GDB, call it (with `gdb') and type in the help command.

GDB has one very nice feature which might even make up for the slowing-down problematic: When a GNU-compiled program crashes, it puts out a core file. When you say "target core core" to the GNU debugger, it reads the core file and can tell you the address of the crash, the contents of variables and of the stack, and so on.

Sometimes it is nice to have a look at the assembler output of the compiler. When you specify the -S command line option, GPC produces an .s file instead of an .o file which contains assembler source for your program. More about this in the next section.


Go to the first, previous, next, last section, table of contents.