12. Commands
● Break
○ Location at which to halt the program
○ Breaks before execution of statement(s)
● Watch
○ Monitors a variable for changes
○ Requires variable to be in scope
● Clear
○ Remove breakpoints
13. Commands
● Checkpoint
○ Store the state of the program
○ Programs can be restarted at checkpoints
● Step
○ Step through the program line by line
● Next
○ Execute the next line in the current frame
○ Does not step through sub-functions
15. Commands
● Print
○
○
○
○
Show the state of memory/variables
Works with array and struct/union notation
Will assume c-strings when applicable
@ can be used on arrays for grouping prints
● Set Var
○ Change memory/variables
● Continue
○ Run until another break/watch point is triggered
17. Recap
● Debugging process is unavoidable
● GDB provides assistance
○ If I see one more stray printf()...
● Basic flow control commands
○ Allow tracing a stopped program
○ Set breakpoints to stop the program
○ Enable querying/modifying the program state