Computer Science Department

GDB Commands

Command            Shortcut          Description  
backtrace   bt   Display program stack.
break <line number>   b <line number>   Set a breakpoint at a specific line number.
continue   c   Continue executing after a breakpoint.
disp <variable>   d <variable>   Print a variable's value at each step of a program.
help   h   Access the online help available for gdb.
next   n   Execute the next statement.
print <variable>   p <variable>   Print a variable's value once.
run   r   Execute the program, stopping at the next breakpoint or when the program terminates.
step   s   Step into a function.
where       Same as backtrace.