Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • r: Run the program

  • b {function_name | line_number}: Puts breakpoint at beginning of function or at a line number

  • info args: Prints function argument values of the current frame

  • info locals: Prints local variable values of the current frame

  • p *{array}@{n}: Prints n values of the array (ideally n is the array length)

  • ptype {struct}: Prints details about type (useful for printing fields in a struct)

  • Epic gdb function I found for printing a linked list: https://stackoverflow.com/questions/16480045/print-the-whole-linked-list-in-gdb

  • n: Step into the next line of the current function, doesn’t step into functions

  • s: Step into the next line of the program: Should probably avoid and use breakpoints for important functions instead

  • frame: Prints the current stack frame + the line of code run (maybe useful for code line highlighting?)

  • where: Prints information about all stack frames

...