Gdb Debugger Flashcards
Run gdb on lab1
Gdb lab1
Break at a specific function
Break function_name
Set a break point at a specific line
Break 15
Next statement
Steps over function calls. Prints the line of code to be executed next
Print command
Will show us the current value of any in-scope variable name.
Disp command
Allows us to continuously watch the value for the variable value. Automatically displays the value fo a expression after every step in execution. Print just prints the variable/expression once
Continue
Means to run all of the code until the next breakpoint
Clear
Gets rid of a break point. For example if we want to get rid of the breakpoint at main, we can say clear main
Delete
Gets rid of all breakpoints
Step
Allows us to enter a function
Set
Allows us to change the value of a variable in gdb
Quit
Allows us to exit gdb debugger
Run < lab1.input1
Runs gdb with redirected input from lab1.input