Tutorial by Examples

GDB, short for GNU Debugger, is the most popular debugger for UNIX systems to debug C and C++ programs. GNU Debugger, which is also called gdb, is the most popular debugger for UNIX systems to debug C and C++ programs. GNU Debugger helps you in getting information about the following: If a co...
To start GDB, in the terminal, gdb <executable name> For the above example with a program named main, the command becomes gdb main Setting Breakpoints You'll probably want you program to stop at some point so that you can review the condition of your program. The line at which you wan...
Created this really bad program #include <stdio.h> #include <ctype.h> // forward declarations void bad_function() { int *test = 5; free(test); } int main(int argc, char *argv[]) { bad_function(); return 0; } gcc -g ex1.c ./a.out //or w...

Page 1 of 1