These notes are by no means comprehensive for further details, use gdbs built-in help function.
Compiling to be able to debug:
g++ -g fname
e.g., g++ -g try1.cppRunning the debugger on the resulting object-file
gdb objFile e.g., gdb a.out
Debugging functions:
Examining the source code
Running the program
Examining/ changing variables
Setting breakpoints
Additional run commands
For further help:
Use gdbs built-in help feature: type help within gdb to obtain a list of help topics. Full documentation on each gdb function is available three levels down the help hierarchy.