![]() | | ||||||||||||||
|
|
| This document describes several techniques and tools for debugging code in C-like languages in a Unix environment. Debugging is the art of removing bugs from software. The software may be code, documentation, or any other intellectual product. Here, we will look at the debugging of computer programs (or libraries) written in C or C++ in a Unix environment. Most of it is also applicable to other compiled procedural and object oriented languages like Pascal, Modula and Objective C. Free Ebook C, C++ Computer Programming: J.H.M. Dassen--Debugging C and C++ code in a Unix environment.pdfWe will mostly focus on techniques and tools to assist in debugging. Of course, it is better to prevent bugs from slipping into your code in the first place. Sometimes it is difficult to distinguish between good coding practices and good debugging practices, because good debugging practices often involve preparation and prevention. So, we will also discuss some good coding practices that you should consider adopting. These practices will not make your programs bug-free, but they will diminish the occurrence of certain types of bugs, while preparing you better for dealing with the remaining ones. It is our experience that many people waste large amounts of time on localizing bugs that are quite easy to fix once they are found, because they are not aware of, or do not know how to use, the tools, techniques and practices available to them. Our goal is to help you prevent wasting your time in this fashion. We hope you will invest time to study the material covered here; we are convinced this investment will pay off. There are some features of the C and C++ languages and the associated build process that often lead to problems. Download free ebook : Debugging_C_and_C++_code_in_a_Unix_environment.pdf Preprocessor C and C++ use a preprocessor to expand macro’s, declare dependencies and import declarations and to do conditional compilation. In itself, this is quite reasonable. You should realise however that all of these are done on a textual level. The C/C++ preprocessor does not This can make it difficult to track down missing declarations, it can lead to semantic problems because of macro expansion and it can cause subtle problems. If you suspect a problem due to preprocessing, check out the preprocessor’s manual (e.g. [CPP]) and let it expand your file for examination. Strong systems dependency C was developed for use as a systems programming language. C and also C++ can give you access to a lot of operating system functionality. Unfortunately, there are a lot of small but significant differences among various Unix systems:
Also, the size and representation of some of C’s and C++’s basic types is dependent on the underlying system. As a C or C++ programmer, you should be aware of what things are explicitly undefined in the C or C++ standard, and thus are implementation (system or compiler) dependent. There are standard ways to overcome some of these problems, like using sizeof instead of the concrete size of the variable on the current system.
|
| |||||||||||||||||||||||||||||||||||||||||||||||||
Halfvalue.com Home | Find Answers | Watch Videos | Halfvalue.co.uk | Halfvalue Einkaufen | Compare Textbook Prices | Travel | Directory of All Stores
| |||
|
Your department store source to buy cheap used and new items online - - Store Directory - - - | |||||||||||||||
| HOME | SITE MAP | BUY | BUY BOOKS | SELL | TRACK | TOP SEARCHES | ACCOUNT | PRIVACY POLICY | USER AGREEMENT | CONTACT US| AVAILABLE ITEMS| | BEST-SELLING BOOKS | RECENT SEARCHES | FEATURED ARTICLES | COMPARE TEXTBOOK PRICES | MORE BUYING OPTIONS |
| FIND A STORE | AUTO | BATH & BEAUTY | GIFTS | HOME IMPROVEMENT | JEWELRY | SPORTING GOODS | TOYS & HOBBIES | TRAVEL |
![]() |