$Id: gdb.txt,v 1.2 1997/07/08 16:35:57 libsq Exp $ GDB COMMANDS There are many more gdb commands, but these are some of the most common. help Lists help options. Remember this command, if nothing else. run starts the program. If no breakpoints are set, it's just as if you run the program from the prompt. list - If is omitted, lists the code about to be executed. - If is the name of a function, lists the code for that function. - If is a line number, list the code starting at that line number in the current file. break Sets a breakpoint at given line number. When the program reaches to that line number, it will stop and return control to the user in gdb. At that point, you can display or modify the value of the variables in the program. where Shows where in the program you are, and what sequence of function calls led to this location. break Similar to "break , but when starting the given function. continue Resume execution after a breakpoint has been reached. delete Eliminates the specified list of break points. If no breakpoints are specified, all are deleted. print Displays the value of the given expression. You can either give a variable name or a simple C expression (for example, if a, b, c are variables in the current function, you can do "print (a + b - c)".) next Executes the next line of code (don't confuse this with the "lines" displayed by "list"). If the next line of code is a function call, the function is executed and gdb will continue to the next line of code after the call. step Similar to next, except that step actually goes inside function calls. continue Will continue to run the program from the current line of code. set Sets variable to the value of .