Home Page

Compiling, Installing
& Debugging in GCC


Debug

Purpose: To find errors
Method:
  1. Compile: gcc -c -Wall -g welcome.c
  2. Link: gcc -o welcome.exe welcome.o
  3. Debug: gdb welcome

Within dgb, here are key commands

commandComment
b mainPut a break in function main(). (Required)
rRun the program (Required)
display varname of the variable whose value to display
ngo to next line
qquit/exit debugger
sstep into a function (dig deeper)

If you are having trouble with debugging, please contact jon@sdba.info. Explain exactly the steps you followed and error messages you received.