# A list of the most useful GDB commands. # # Author: Sol Boucher b - Set breakpoint at specified line or function (to stop just before it's executed). bt - Print a stack trace. c - Continue program. d - Delete breakpoints and display expressions. dis - Temporarily disable breakpoints and displays. disas - Disassemble. disp - Print expression evaluation each time the program stops. en - Reenable breakpoints and displays. f - Select a different stack frame. h - Help. i - Print information on breakpoints, displays, watchpoints, registers. l - Source listing. la - Display source, assembly, both, and/or registers side-by-side with console. n - Step to next C expression. ni - Step to next assembly instruction. p - Print variable or register. q - Quit. r - Run the program, optionally with command-line arguments. rec - Start recording execution for backward debugging. ref - Refresh the display (same as Ctrl-L). rn - Step *backward* to previous C expression. rni - Step *backward to previous assembly instruction. rs - Step *backward* to previous C expression, possibly into a function. rsi - Step *backward to previous assembly instruction, possibly into a function. s - Step to next C expression, possibly into a function. si - Step to next assembly instruction, possibly into a function. wa - Set a watchpoint on an expression (to stop just after it's updated). x - Print memory contents pointed by variable or register.