Buy New

or
Sign in to turn on 1-Click ordering.
or
Amazon Prime Free Trial required. Sign up when you check out. Learn More
Buy Used
Used - Acceptable See details
$4.64 & eligible for FREE Super Saver Shipping on orders over $25. Details

or
Sign in to turn on 1-Click ordering.
 
   
More Buying Choices
Have one to sell? Sell yours here
Debugging Windows Programs: Strategies, Tools, and Techniques for Visual C++ Programmers
 
See larger image
 
Tell the Publisher!
I'd like to read this book on Kindle

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.

Debugging Windows Programs: Strategies, Tools, and Techniques for Visual C++ Programmers [Paperback]

Everett N. McKay (Author), Mike Woodring (Author)
4.5 out of 5 stars  See all reviews (13 customer reviews)

List Price: $44.95
Price: $36.48 & this item ships for FREE with Super Saver Shipping. Details
You Save: $8.47 (19%)
  Special Offers Available
o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o
In Stock.
Ships from and sold by Amazon.com. Gift-wrap available.
Only 2 left in stock--order soon (more on the way).
Want it delivered Monday, January 30? Choose One-Day Shipping at checkout. Details
Textbook Student FREE Two-Day Shipping for Students. Learn more


Book Description

020170238X 978-0201702385 August 28, 2000 1
Bugs happen -- and as code becomes increasingly complex, bugs become even harder to prevent, detect, and remove. Moreover, code built with COM, DCOM, ATL, and multithreading presents new debugging challenges. Debugging Windows Programs presents today's best techniques for tracking down bugs in Windows software -- as well as a strategic approach for achieving optimal results without unnecessary expense and delay. The book presents in-depth coverage of debugging using Visual C++ 7.0 and the MFC and ATL application frameworks, with much of the coverage applicable to other Windows C++ development environments and programming languages as well. Part I focuses on debugging strategies, including how to write code that helps reveal bugs. Next, the book shows how to make the most of the leading Windows debugging tools, including the Visual C++ Debugger. Finally, in Part III, the author focuses on specific solutions to the most common debugging problems, covering memory, pointers, function returns, Windows resources, and much more.

Special Offers and Product Promotions

  • Buy $50 in qualifying physical textbooks, get $5 in Amazon MP3 Credit. Here's how (restrictions apply)

Frequently Bought Together

Customers buy this book with Debugging: The 9 Indispensable Rules for Finding Even the Most Elusive Software and Hardware Problems $15.20

Debugging Windows Programs: Strategies, Tools, and Techniques for Visual C++ Programmers + Debugging: The 9 Indispensable Rules for Finding Even the Most Elusive Software and Hardware Problems
Price For Both: $51.68

One of these items ships sooner than the other. Show details



Editorial Reviews

Amazon.com Review

Debugging Windows Programs: Strategies, Tools, and Techniques for Visual C++ Programmers sounds like it might focus on using a debugger exclusively, but this book is actually a wide-ranging tour of how to write better, more robust Visual C++ code that can be debugged more easily. Mixing plenty of nuts-and-bolts tips with higher-level strategies for effective testing, Debugging Windows Programs offers plenty of valuable expertise for any working C++ programmer.

The focus is on providing practical tips for more successful debugging, but many of the suggestions are for tweaking the way in which you write C++ code. Early sections examine how to take full advantage of assert statements (whether in C, MFC, or custom functions), which can be used to write safer code; trace statements, which are used to log debug messages, are covered, too. (Chances are that you haven't seen all of the APIs; luckily, they're rounded up for you here.) There are also numerous tips about C++ style, like how to choose readable variable names, along with the debugging dos and don'ts of working with errors, exceptions, COM objects, and threads.

Chances are, even if you are an experienced Visual C++ programmer, you'll learn something useful about how to get more out of the C++ debugger from the last sections of this book. From the right compiler and linker switches (which can be mysterious) to how to customize watch variables by tweaking the configuration files in C++, you'll learn how to be more productive with this tool. The text concludes with another useful section, an FAQ-style listing of dozens of common debugging questions and answers.

Although it's highly practical, the book also recommends thinking about your code, applying strategies for each aspect of debugging features consistently and effectively. The bottom line is that you not only will find bugs in present code, but also you'll design code that's easier to test and debug in the future. In all, Debugging Windows Programs delivers a good mix of practical tips and strategies that'll help C++ programmers create more robust (and testable) code. --Richard Dragan

Topics covered:
  • The debugging and testing process
  • Tips for writing better Visual C++ code
  • Assertions (C, MFC, and custom assert statements)
  • Logging output with trace statements (including trace APIs)
  • Exception handling and debugging
  • First-chance and last-chance exceptions
  • Tips for better debugging in C++
  • Naming conventions
  • Postmortem
  • Just-in-time (JIT) and remote debugging

  • Using map and .pdb files
  • Compiler and linking options
  • Debug windows
  • Customizing the C++ debugging environment
  • Basic and advanced debugging techniques
  • Catching memory leaks with the debug heap
  • Debugging multithreaded programs (including avoiding race conditions and deadlock)
  • A primer for COM debugging
  • Frequently asked questions and answers about debugging
  • From the Inside Flap

    Debugging Windows programs is a large, complex subject. A book that covered all possible aspects of Windows debugging could easily be twice the size of this book. The problem with such a comprehensive approach to the subject is that the results would be so large and intimidating that few people would want to read it. Consequently, we had to draw the line somewhere and focus on some aspects of Windows debugging at the exclusion of others. Let's start by explaining how we chose to draw that line.

    The fundamental motivation behind this book is the belief that programmers' debugging skills could be much improved if they had access to better debugging information. Although plenty of debugging information is available, it is not currently in a form that a programmer can read and then have mastery of the subject. Too often the information is vague and incomplete, or the focus is on debugging tools instead of debugging concepts. The ultimate debugging tool is the programmer's mind, and too often that tool has been neglected. Mastering fundamental Windows debugging concepts will help you prevent many bugs and find the remaining bugs more efficiently, even if you are the most gung ho tool user.

    This book identifies the fundamental debugging skills required for effective Windows debugging. Once you have read a chapter, you should have that chapter's subject wired. Part I of the book focuses on debugging strategies to help you understand the debugging process and how to use the C++ language, assertions, trace statements, and exceptions to prevent, reveal, diagnose, and remove bugs. Part II focuses on debugging tools included in Visual C++ as well as Windows. Part III focuses on debugging techniques to help you get the most out of Visual C++ debugging tools, with special attention to debugging memory-related problems, multithreaded programs, and COM.

    Some subjects addressed here straddle the border between programming skills and debugging skills. However, since bug prevention is very much a part of debugging, you need to know the common programming mistakes in order to avoid making them. Most programming texts avoid the subjects of debugging and bug prevention, so these subjects need to be addressed.

    What's missing in the presentation is also notable. We have largely avoided discussing third-party debugging tools or any Microsoft debugging tools that are not part of Visual C++ (such as WinDbg) or Windows. There are several motivations for this decision. The obvious motivation is to stay focused on debugging concepts and not get side tracked by documenting tools. Another strong motivation is that Visual C++ programmers need better information on how to use the tools they already have. Finally, we doubt that we could say anything about these other tools that would be more helpful than the information provided by the tool vendors themselves. But I Use BoundsChecker . . . Some readers are now thinking, "But I use BoundsChecker, so why should I read this book?" Excellent question. Debugging tools, such as Compuware NuMega's BoundsChecker and Rationale Software's Purify, do an excellent job of finding many types of runtime errors--bad pointers and handles, memory corruption and leaks, bad Windows API parameters, and so on. What they don't do is help you understand the debugging process, including how to use the C++ language, assertions, trace statements, and exceptions to prevent and remove bugs, how to take full advantage of the debugging tools that are part of Visual C++ Windows, or how to debug multithreaded programs and COM--all of which this book does.

    Furthermore, these tools certainly do not detect all bugs, and they do nothing to help you prevent bugs. If you are totally dependent on debugging tools, you will be helpless when presented with bugs these tools don't find. In addition, using these tools requires you to perform an extra development step, and they can have a significant impact on runtime performance, whereas many of the bug-detection techniques described in this book happen automatically whenever you run the debug build and have a minimal impact on performance. Debugging is a complex puzzle, but these debugging tools will help you with only one piece. How to Read This Book Although our hope is that you will read this book from cover to cover, we realize that many readers are in a hurry and won't have the time to read a whole book in order to track down a bug. Consequently, each chapter is largely self-contained so you should be able to read only the chapters you need in the order you want. This self-containment approach means there are some bits of redundant material that apply to more than one chapter, although we tried to keep such redundancy to a minimum. We hope you will agree that this approach makes the book a much more useful reference.

    After the Contents, there is a list of answers to frequently asked questions, which can quickly guide you to solutions to many common debugging problems. Chapter 8 is also organized in this way, and either the FAQ list or the chapter can help you quickly find an answer to a specific debugging question.

    There are many different types of Windows programs, so there are many different types of debugging techniques. Debugging is presented from the point of view of the Windows API, as well as the MFC and ATL application frameworks. We have clearly identified the material that is specific to MFC and ATL; so if you're not using these frameworks, feel free to skip over those sections if you are in a hurry. If you're not in a hurry, you might want to read them because it is often useful to look at debugging from other points of view.

    Finally, each chapter contains key points of advice about debugging, which are presented in a special format as shown here.

    These tips highlight the most useful debugging ideas, make the text easier
    to scan, and will help you locate important debugging topics quickly. Windows Versions and Hardware To simplify the presentation, we refer primarily to the current versions of Windows, which at the time of this writing are Windows 2000 and Windows 98. Almost everything said here about Windows 2000 applies to Windows NT 4.0, and nearly everything said about Windows 98 also applies to Windows 95. We mention Windows NT 4.0 and Windows 95 only when referring to those specific versions of Windows.

    To further simplify the presentation, we assume you are using Windows on an Intel x86 central processing unit (CPU). Although most of this book is CPU independent, the specific CPU becomes a factor when you are reading hex dumps or debugging at the assembly-language level. For those of you doing assembly-level debugging on a non-Intel platform, you have our sympathy, but not much else. Who Is "I"? Although there are two names on the cover, we wrote this book using the first person. Each chapter tells its story from the point of view of a single author. Mike Woodring wrote Chapter 10, Debugging Multithreaded Programs, and Chapter 11, COM Debugging, whereas Everett McKay wrote the remainder. Consequently, the "I" in Chapters 10 and 11 refers to Mike Woodring, whereas the "I" in the other chapters refers to Everett McKay. For Updated Information The information in this book is based on Microsoft Visual C++ version 6.0. If you are using a later version of Visual C++, chances are the majority of this book is still accurate but a few details related to the compiler or debugger have changed. To help keep this book's information fresh, we will post any updates or corrections at windebug, along with selected debugging tools. Should you find any errors or out-of-date information, please let us know by sending an e-mail message to corrections@windebug.

    020170238XP04062001


    Product Details

    • Paperback: 592 pages
    • Publisher: Addison-Wesley Professional; 1 edition (August 28, 2000)
    • Language: English
    • ISBN-10: 020170238X
    • ISBN-13: 978-0201702385
    • Product Dimensions: 9.2 x 7.3 x 1.3 inches
    • Shipping Weight: 2.1 pounds (View shipping rates and policies)
    • Average Customer Review: 4.5 out of 5 stars  See all reviews (13 customer reviews)
    • Amazon Best Sellers Rank: #1,022,957 in Books (See Top 100 in Books)

    More About the Author

    Discover books, learn about writers, read author blogs, and more.

     

    Customer Reviews

    13 Reviews
    5 star:
     (10)
    4 star:
     (1)
    3 star:
     (1)
    2 star:
     (1)
    1 star:    (0)
     
     
     
     
     
    Average Customer Review
    4.5 out of 5 stars (13 customer reviews)
     
     
     
     
    Share your thoughts with other customers:
    Most Helpful Customer Reviews

    15 of 15 people found the following review helpful:
    5.0 out of 5 stars "must have" for general debugging, April 8, 2002
    This review is from: Debugging Windows Programs: Strategies, Tools, and Techniques for Visual C++ Programmers (Paperback)
    In my experience, programmers fall into two categories: general (majority) and advanced (few); advanced ones understanding register and stack dumps etc, general ones being lost. This book covers the more general programmer, Robbins book the advanced. Comparing the two, you could write your own debugger and your own "core" dumps (which you can then examine) from Robbins book; with this one you can't, but it covers useful stuff missing from Robbins book (eg. PE format, address space partitioning). As such they have some overlap but supplement each other. Both books are essential to serious developers. I have one gripe with this and Robbins book: neither suggests outputting the mixed source/assembly/machine_code (.COD files); these are essential (without a .PDB) if a crash occurs so that the offending instruction etc. can be found, as many instructions usually follow a line of source; secondly, function locals only show in .CODs (as offsets from EBP) so making them easy to locate on a stack trace.
    Help other customers find the most helpful reviews 
    Was this review helpful to you? Yes No


    12 of 12 people found the following review helpful:
    5.0 out of 5 stars Bugs? My codes only have features..., September 5, 2000
    By 
    This review is from: Debugging Windows Programs: Strategies, Tools, and Techniques for Visual C++ Programmers (Paperback)
    This book should have been included with the MS Visual C++ documentation. If you can say "My code doesn't have bugs, only features," then you may skip this book. I found this book full of tips and tricks and secrets of visual c++ debugging. Just by having this book on your side, you will save hours and hours of frustration trying to find that one line that's keeping you from going home.
    Beginning few chapters are basic debugging knowledge every visual C++ programmers should be aware of. It explains more of 'preventive' programming styles so that you notice your bugs before your customers. Various topics including assert and compiler options are well explained, much better than the ones you would find in the vc++ documentation.
    I was happy to finally see some explanation on Dr. Watson messages. In Chapter 6: Debugging with Windows, Woodring and McKay explains all the precious information buried in those memory dumps that we often ignore. After all, all those hexadecimal numbers got to mean something, right?
    If you have been always unsure about your multithread knowledge, this book contains a good section on multithread programming issues and how to monitor your threads from the debugger.
    And for those who can't sleep at night because of some odd bug buried in thousands of lines of code, I recommend jumping right into Chapter 12: Desperate Measures. You are probably too frustrated to think straight now. Let this book help you calm down and look through your code step by step. This chapter simply provides a code checking checklist that you should probably copy down and tape it to your monitor.
    For those of you that are starting a fresh batch of code and thinking about buying this book, my recommendation is to read this book first, then code. You'll be a lot happier later. And for those of you that have already written a few million lines of code and trying to debug, you can apply some of the techniques found in this book to build up confidence in your code. I suppose if you live dangerously ("Just let 'er rip and hope for the best"), then most of the things explained in this book will only seem annoying to you, but I'm sure most of you programmers out there would like to know a few neat debugging tricks to show off in front of your co-workers.
    Help other customers find the most helpful reviews 
    Was this review helpful to you? Yes No


    10 of 10 people found the following review helpful:
    5.0 out of 5 stars An invaluable book  packed with immediately useful macros, September 23, 2000
    This review is from: Debugging Windows Programs: Strategies, Tools, and Techniques for Visual C++ Programmers (Paperback)
    The vast majority of recommendations are so simple, yet so effective. Even if you only read random sections of this book, it will be of immediate benefit. This book in conjunction with John Robbin's book (Debugging Applications) are invaluable in not just giving you tips on how to find bugs but much more importantly how to code defensively to reduce the chances of bugs occurring in the first place.

    As the authors mention in the preface, they are not many original ideas in the book - but it is a good consolation of publicly available information. The book adds value by explaining when to use certain techniques and when to use others e.g. Chapter 5 -Using exceptions vs. return values.

    Because the book is specifically geared to C++ programmers there are some fantastic macros. For instance _CoCreateServer which wraps CoCreateInstance but gives detailed error information if anything goes wrong. Chapter 9 - Debugging Memory was particularly useful. Being able to detect leaking memory in ATL components (just like MFC does) was worth the price of the book alone.

    My only criticism is the use of the Arial font which makes the book a little getting used to seeing on the printed page.

    Help other customers find the most helpful reviews 
    Was this review helpful to you? Yes No

    Share your thoughts with other customers: Create your own review
     
     
     
    Most Recent Customer Reviews











    Only search this product's reviews



    What Other Items Do Customers Buy After Viewing This Item?


    Suggested Tags from Similar Products

     (What's this?)
    Be the first one to add a relevant tag (keyword that's strongly related to this product).
     
    (57)
    (25)

    Your tags: Add your first tag
     

    Sell a Digital Version of This Book in the Kindle Store

    If you are a publisher or author and hold the digital rights to a book, you can sell a digital version of it in our Kindle Store. Learn more

    Customer Discussions

    This product's forum
    Discussion Replies Latest Post
    No discussions yet

    Ask questions, Share opinions, Gain insight
    Start a new discussion
    Topic:
    First post:
    Prompts for sign-in
     


    Active discussions in related forums
    Search Customer Discussions
    Search all Amazon discussions
       
    Related forums





    Look for Similar Items by Category


    Look for Similar Items by Subject