To compile program in debug mode using gcc use below command gcc -g -o <outputfilename> <inputfilename.c> the use gdb <outputfilename> and try below commands GDB commands by function - simple guide --------------------------------------- More important commands have a (*) by them. Startup % gdb -help print startup help, show switches *% gdb object normal debug *% gdb object core core debug (must specify core file) %% gdb object pid attach to running process % gdb use file command to load object Help *(gdb) help list command classes (gdb) help running list commands in one command class (gdb) help run bottom-level help for a command "run" (gdb) help info list info commands (running program state) (gdb) help info line help for a particular info command (gdb) help show list show commands (gdb state) (gdb) help show commands specific help for a show command Breakpoints *...
Let's make world safe, use technology wise