| At line 5 changed one line |
| C programs should be compiled with -g |
| C programs should be compiled with -g -Og |
| At line 11 changed one line |
| {{{gdb myProgram core}}} |
| {{{gdb myProgram [core]}}} |
| At line 14 changed 15 lines |
| | run [[args] | run the program |
| | kill | stop program from running |
| | quit | exit debugger |
| | help | |
| | ^C | stop / interrupt the program |
| | continue | continue execution |
| | list | show program code |
| | next | go over next line |
| | step | go into next line |
| | print x | print value of x |
| | backtrace | show stack |
| | frame n | change to stack frame n |
| | info frame | |
| | info locals | |
| | info args | |
| | run [[args] | r | run the program |
| | kill | k | stop program from running |
| | quit | q | exit debugger |
| | help | h | |
| | ^C | | stop / interrupt the program |
| | continue | c | continue execution |
| | list | l | show program code |
| | next | n | go __over__ next line |
| | step | s | go __into__ next line |
| | finish | fin | exit stack frame (go __up__) |
| | print x | p | print value of x |
| | backtrace | bt | show stack |
| | frame n | f | change to stack frame n |
| | info locals | i lo | display local variables |
| | info args | i ar | display command line arguments |
| | info frame | i f | stack frame information |
| At line 32 changed 5 lines |
| | break file.c:45 | set breakpoint at line 45 of file.c |
| | break myfun | set breakpoint at beginning of myfun() |
| | info breakpoints | list breakpoints |
| | disable 2 | disable breakpoint 2 |
| | clear XXXX | delete breakpoint |
| | break file.c:45 | b | set breakpoint at line 45 of file.c |
| | break myfun | b | set breakpoint at beginning of myfun() |
| | info breakpoints | i br | list breakpoints |
| | disable 2 | | disable breakpoint 2 |
| | clear XXXX | cl | delete breakpoint at location XXXX |
| | delete nnn | d | delete breakpoint number nnn |
|
| When lines are displayed, it is showing the line that is about to be executed, not the line that was just executed. |
|