Debuggers
gdb
gdb - GNU Debugger
Breakpoints
-
breakpoints are the points where debugger will stop the program execution, and then you can inspect the memory i.e. variables
-
b main- puts breakpoint at the beginning of the program b- puts breakpoint at the current lineb N- puts breakpoint at the line Nb +N- puts breakpoint N lines down from the current lineb fN- puts the breakpoint at the beginning of the functionfNd N- deletes the breakpoint number Ninfo breaks- list breakpoints
Continues or run till error
r- runs the program until a breakpoint or errorc- continues running the program until the next breakpoint is reached
Run until next function
f- runs until the next function is finished
Step
s- runs the next line of programs N- runs next N lines of the program
Skip over
n- likesbut does not step into functionsu N- runs until you get N lines in the front of the current line
Inspecting
p var- prints the current value of the variablevar