O'Reilly logo

Programming in C, Third Edition by Stephen G. Kochan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 18. Debugging Programs

THIS CHAPTER TEACHES YOU TWO TECHNIQUES you can use to debug your programs. One involves using the preprocessor to allow for the conditional inclusion of debugging statements in your program. The other technique involves the use of an interactive debugger. In this chapter, you are introduced to a popular debugger called gdb. Even if you use a different debugger (such as dbx, or one built in to an IDE tool), it is likely that your debugger will have similarities to gdb.

Debugging with the Preprocessor

As noted in Chapter 13, “The Preprocessor,” conditional compilation is useful when debugging programs. The C preprocessor can be used to insert debugging code into your program. By appropriate use of #ifdef statements, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required