News Archive (1999-2012) | 2013-current at LinuxGizmos | Current Tech News Portal |    About   

Free book chapter explains debugging

Sep 9, 2008 — by Eric Brown — from the LinuxDevices Archive — 3 views

No Starch Press is offering a free chapter of its book on using open source debugging tools. Written by Norman Matloff and Peter Jay Salzman, The Art of Debugging with GDB, DDD, and Eclipse offers readers advice and strategies for each tool, says No Starch.

(Click for larger view of the cover of The Art of Debugging)

The process of finding and fixing programming errors can be challenging even to experienced programmers, say the publishers. The Art of Debugging offers real-world examples of coding errors to show why programs crash or throw exceptions, says No Starch. The book then provides tips and strategies for using what it calls the three most popular open source debugging tools:

The Art of Debugging is said to provide specific tips on how to:

  • Inspect variables and data structures
  • Understand segmentation faults and core dumps
  • Use features like catchpoints, convenience variables, and artificial arrays
  • Avoid common debugging pitfalls
  • Prevent errors in the first place by making the best usage of editors, compilers, and static code checkers
  • Work with threads, client-server technology, GUIs, and parallel programming

Free chapter: Surprises are good!

The freely available first chapter of the book, called “Some Preliminaries for Beginners and Pros,” is available from a link at the end of this page. The chapter summarizes the tools used in the book and explains the principles of debugging. For example: “When you find that one of your assumptions is not true, you have found a clue to the location (if not the exact nature) of a bug. Another way of saying this is: Surprises are good!”

The chapter offers strategies such as using a top-down, modular, approach to debugging; using debugging tools to determine the location of segmentation faults; using interrupts to find the location of infinite loops; and, applying a binary search. The authors then go on to explore the pros and cons of text- vs. GUI-based debugging, as well as the GDB compromise between the two called TUI (Terminal User Interface), and the CGDB interface to GDB. The bulk of the chapter covers an introductory debugging example, primarily with GDB, but also with sections on using DDD and Eclipse with the same code.

Norman Matloff is a computer science professor at UC Davis and the author of public-domain software packages and online tutorials. Co-author Peter Jay Salzman received his doctorate in theoretical physics at UC Davis and founded the Linux Users Group of Davis. He is now a programmer with a Wall Street financial firm.

Stated No Starch Press publisher Bill Pollock, “Programmers are desperate for a book devoted to debugging, particularly with GDB and DDD. Finally, the wait is over. No more debugging by hand.”

Availability

No Starch Press's 280-page The Art of Debugging with GDB, DDD, and Eclipse, by Norman Matloff and Peter Jay Salzman, is available now for $40, says O'Reilly, which is distributing the book. More information may be found here.

The sample chapter: “Chapter 1: Some Preliminaries for Beginners and Pros,” can be found in PDF form, here.


 
This article was originally published on LinuxDevices.com and has been donated to the open source community by QuinStreet Inc. Please visit LinuxToday.com for up-to-date news and articles about Linux and open source.



Comments are closed.