Skip to content

Instantly share code, notes, and snippets.

@KeyC0de
Created November 21, 2020 12:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KeyC0de/3e974b28d732fb3ecfe03bceaf36c0cf to your computer and use it in GitHub Desktop.
Save KeyC0de/3e974b28d732fb3ecfe03bceaf36c0cf to your computer and use it in GitHub Desktop.
gcc -g to compile a program and include debugging information
start - begin exexuting your program
list - examine your source code from within the debugger
step - execute the next line of your program
next - execute the next line of your program, but if it's a subroutine call, treat the entire subroutine as a single line
print - examine the contents of a variable
x - examine memory directly
watch, rwatch - set a watch for when a variable is written or read: return to the debugger once this happens
break - set a breakpoint: return to the debugger when this line of code is about to be executed
info watch - show info on watchpoints
info break - show info on breakpoints
delete # - delete watchpoint or breakpoint "#"
cont - continue from a breakpoint, watchpoint, step, next, etc.; basically begin running your program from where it left off
set var name=value set the value of variable "name" to "value"
bt - show the call frames for your program
frame # - set the current frame to #. Variables you reference etc. will be those within that context.
quit - leave the debugger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment