Source: https://www.youtube.com/watch?v=svG6OPyKsrw
ToC
- 00:00 intro
- 03:52 compile for GDB
- 06:23 run
- 07:24 break
- 10:00 next
- 10:46 list
- 12:06 print
- 15:14 quit
- 19:18 up/down
- 21:44 display/undisplay
- 26:30 backtrace
- 29:55 step
- 31:57 continue
- 34:40 finish
- 40:16 watch
- 43:40 info/delete
- 47:15 whatis
- 49:43 target record-full/reverse
Compile for GDB
g++ -g -std=c++14 [filename].c -o [output]
According to https://bytes.usc.edu/cs104/wiki/gcc/
-gprovides debugging feature for your program. You will need this when you want to use gdb or valgrind.--std=c++<##>uses version<##>of C++ when compiling. This will allow you to use specific features of that C++ version. Typically, we have you use--std=c++17.-o <filename>compiles and links files into an executable named<filename>. The default filename isa.out.- And etc
- *Bonus: https://stackoverflow.com/questions/5179202/gcc-g-what-will-happen