GDB

Stack Navigation and Going in Reverse

More Features, Reference Sheet

Command Abbreviation Description
run r Runs the selected program until the next Breakpoint or Watch
break b Sets a breakpoint at a line or function (Current line by default)
watch wa Sets a watchpoint
next n Steps through next line of code (Does not enter function call)
step s Steps into next line of code (Enters function call if any)
continue c Run from current point to next Breakpoint or Watch
info breakpoints i b List out all breakpoints and watchpoints
delete d Delete breakpoint or watchpoint with given id
print p Prints out the value of the given variable
whatis what Prints out the type of the given variable
display disp Print out the value of a variable at each step
undisplay undisp Undo a "display" command
up up Move up the call stack
down do Move down the call stack
backtrace bt Print a trace of the current call stack
finish fin Run to the end of the current function call
record record Begin recording additional information to enable reverse debugging (must be called after run)
reverse-next rn Steps backward through code (Does not enter function call)
reverse-step rs Steps backward through code (Enters function call if any)
set var set var Modify the value stored in a variable during execution

oh yeah you can set up breakpoints in vscode as well lmao