O'Reilly logo

Mastering C++ Programming by Jeganathan Swaminathan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

GDB commands quick reference

The following GDB quick tips chart will help you find the GDB commands for debugging your applications:

Command Short command Description
gdb yourappln.exe - Opening an application in GDB for debugging
break main b main Set the breakpoint to the main function
run r Executes the program till it reaches the breakpoint for step-by-step execution
next n Executes the program one step at a time
step s Steps into the function to execute the function step by step
continue c Continues the execution of the program until the next breakpoint; if no breakpoints are set, it will continue the execution of the application normally
backtrace bt Prints the entire call stack
quit

q or

Ctrl + d 

Exits GDB

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required