Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Norman Matloff, Peter Jay Salzman

Rating No ratings yet

I must come clean first - I know the authors. Peter asked me to review one of the sections in the book many ages ago when the book was in its infancy. The book has progressed much since then, and I must admit this is much more than I was expecting from a book about debugging! Chapters 1 through 3 are the starter chapters that discuss the core debugging paradigms such as breakpoints and variable analysis. Chapter 1 goes through some of the basic concepts of debugging for those new to the idea (e.g., hobbyists and just-out-of-college programmers) but it's probably less useful for those already familiar with the concept. Chapter 2 goes through the basic debugging operations, such as setting breakpoints and analyzing variables, with an emphasis on how breakpoints can be set, cleared, and triggered using various methods. Chapter 3 goes through more on how variables of different storages can be viewed and displayed. Chapters 4 and 5 are where things start to get interesting. Chapter 4 discusses how the debugger can be used to analyze core dumps, and touches on operating system concepts just enough to be productive in debugging for those not familiar with OS architectures. Chapter 5 discusses debugging threaded applications. As examples, applications written using popular multi-threaded and multi-process libraries such as pthread, MPI, and OpenMP are discussed, which makes the chapter more practical. Chapter 6 is an interesting chapter. Section 6.1 goes through some common compiler error messages and how one should interpret them. They're concepts all first semester programming course students should read. It should be read either before chapter 1 or immediately after for beginning programmers, but it's also an entertaining section to read for the experienced programmers who goes through what the section discusses on a daily basis without ever giving it a second thought anymore. Section 6.2 should be a great read for anyone whose hair turned gray trying to debug Curses or

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
【One-Line Pitch】 A practical, tool-focused guide to debugging C and C-family programs with GDB, DDD, and Eclipse—teaching you to stop sprinkling print statements and start using breakpoints, watchpoints, core dumps, and thread-aware inspection. Best for students, hobbyists, and working programmers who know how to code but were never formally taught how to debug. 【Book Arc】 - **Opening (~0%–15%)**: Frames debugging as a discipline built on the "Principle of Confirmation," compares text-based vs. GUI debuggers, and walks a first hands-on session in all three tools. - **Early (~15%–35%)**: The workhorse chapters—breakpoints in every flavor (setting, listing, disabling, conditional, command lists, watchpoints) and inspecting/setting variables, including dynamic arrays and linked structures. - **Middle (~35%–55%)**: Moves into harder territory: reading core dumps and segmentation faults with just enough OS/memory background, then debugging threaded and parallel code (pthread, MPI, OpenMP) and client/server programs. - **Late (~55%–80%)**: Special topics and the wider toolbox—compiler error messages, missing libraries, Curses/GUI debugging, editors, compiler warnings, errno, strace/ltrace, static checkers, and dynamically allocated memory problems. - **Ending (~80%–100%)**: Extends the same debugger skills to other languages (Java, Perl, Python, SWIG, assembly), showing how GDB/DDD/Eclipse adapt beyond C. 【Key Takeaways】 - **Debugging is confirmation, not guesswork** (Opening): the book's core principle is that you form a hypothesis and use the tool to confirm or refute it, rather than randomly editing code. - **Breakpoints are the central skill** (Early): the text treats setting, deleting, disabling, persisting, and conditioning breakpoints as the foundation everything else builds on. - **Watchpoints catch silent state changes** (Early): when a variable is mysteriously overwritten, watching it is often faster than stepping through logic. - **Variable inspection deserves real depth** (Early): displaying structs, dynamic arrays, and tree nodes at a pause is where GDB's flexibility pays off, with DDD offering graphical views of linked data. - **Core dumps turn crashes into evidence** (Middle): understanding how core files are created—and that your shell may suppress them—lets you post-mortem a segfault instead of reproducing it. - **Concurrency changes the debugging game** (Middle): threaded and parallel programs (pthread, MPI, OpenMP) require thread-aware commands and a mental model of processes vs. threads. - **The debugger is only one tool** (Late): compiler warnings, strace/ltrace, static checkers, and memory-debugging tools complement GDB for whole classes of bugs. - **The same skills transfer across languages** (Ending): GDB, DDD, and Eclipse can be pressed into service for Java, Perl, Python, and even assembly, so the investment generalizes. 【Reading Tips】 - Beginners should read Chapter 1 and the compiler-error section (6.1) first; experienced programmers can skim Chapter 1 but should not skip its general guidelines. - Deep-read the breakpoint and variable-inspection chapters—they are the daily-use core—and practice each command in all three interfaces rather than just reading. - Treat the OS/memory background in the crash chapter as optional if you already have systems knowledge; skim it, but slow down for core-file mechanics. - If you work on threaded or parallel code, prioritize Chapter 5; otherwise it can be read later as reference. - Use the later chapters as a menu: jump to the tool or language section relevant to your current bug rather than reading linearly. 【Coverage Limits】 This guide is synthesized from stratified excerpts and the book's front matter, table of contents, and preface; it does not cover the detailed command syntax, worked examples, or code listings inside each chapter.
Excerpt 1
all first semester programming course students should read. It should be read either before chapter 1 or immediately after for beginning programmers, but it'...
View in text
Page 4
. . . . . 17 1.6 Online Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ....
View in text
Page 4
8 4.2 Core Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 4.2....
View in text
Page 8
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240 8.1.3 Using DDD as a GUI for JDB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ....
View in text
Page 11
d Eclipse to interact with the events in your curses window. As noted earlier, the debugging process can be greatly enhanced through the use of supplementary...
View in text
Excerpt 6
The following rule is the essence of debugging: 2 Chapter 1 The Fundamental Principle of Confirmation Fixing a buggy program is a process of confirming, one...
View in text
Page 17
process or, better yet, use your text editor’s undo feature. See Chapter 7 for tips on making good use of an editor while programming. 1.4 Text-Based vs. GUI...
View in text
Page 19
In this way you can see your breakpoints at a glance. 1.4.1.3 Eclipse: A GUI Debugger and Much More Now, Figure 1-3 introduces the general environment in Ecl...
View in text
Tags
AI categories
ProgrammingSoftware
ISBN: 1593271743
Publisher: No Starch Press
Publish Year: 2008
Language: English
Pages: 278
File Format: PDF
File Size: 4.7 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…