Conquering Debugging
Marc Gregoire · 2021
This chapter provides concrete debugging guidelines and techniques. It begins with the fundamental law of debugging and bug taxonomies, followed by tips for avoiding bugs. Techniques for planning for bugs include error logging, debug traces, assertions, and crash dumps. Specific tips are given for debugging the problems that arise, including techniques for reproducing bugs, debugging reproducible bugs, debugging nonreproducible bugs, debugging memory errors, and debugging multithreaded programs. The chapter describes the major categories of memory errors. Each category lists different types of memory errors, including a small code example demonstrating each error, and a list of possible symptoms that the readers might observe. The most important rule when debugging is to reproduce the problem. Then, the readers can use a symbolic debugger, or log-based debugging, to track down the root cause.