Appendix B: Debugging Programs
Fred Brooks, the father of the IBM mainframe, wrote in his famous book, The Mythical Man-Month, that software development requires one-third of the time to design and half of the time to test, but only one-sixth to code. Even when written by a programmer with rich development experience, programs are almost always prone to mistakes.
Through the process of debugging the program, we can monitor every detail of the program execution, including the value of variables, the calling process of functions, the data in memory, and the scheduling of threads, just to find hidden errors or inefficient sections of code.
We will cover the following topics in this appendix:
- Debugging with GDB
- Debugging with Visual Studio Code (VSCode)
- Understanding
sbmask()
as a tool for debugging