Debugging Windows Programs: Strategies, Tools, and Techniques for Visual C++ Pro
暫譯: Windows 程式除錯:Visual C++ 專業版的策略、工具與技術
Everett N. McKay, Mike Woodring
- 出版商: Addison Wesley
- 出版日期: 2000-08-28
- 售價: $1,880
- 貴賓價: 9.5 折 $1,786
- 語言: 英文
- 頁數: 592
- 裝訂: Paperback
- ISBN: 020170238X
- ISBN-13: 9780201702385
-
相關分類:
C++ 程式語言、Visual C++
已絕版
買這商品的人也買了...
-
$1,029Fundamentals of Data Structures in C++
-
$680$537 -
$2,870$2,727 -
$980$774 -
$560$504 -
$1,078Computing Concepts With Java Essentials, 3/e
-
$490$387 -
$650$514 -
$560$476 -
$650$514 -
$590$466 -
$1,740$1,653 -
$830$813 -
$690$538 -
$720$569 -
$750$638 -
$490$382 -
$560$476 -
$420$328 -
$880$695 -
$850$723 -
$480$379 -
$750$593 -
$780$616 -
$590$460
商品描述
Summary
For professional software developers, debugging is a way of life. This book is the definitive guide to Windows debugging, providing developers with the strategies and techniques they need to fulfill one of their most important responsibilities efficiently and effectively.
Debugging Windows Programs shows readers how to prevent bugs by taking full advantage of the Visual C++ development tools and writing code in a way that makes certain types of bugs impossible. They also will learn how to reveal bugs with debugging statements that force bugs to expose themselves when the program is executed, and how to make the most of debugging tools and features available in Windows, Visual C++, MFC, and ATL. The authors provide specific solutions to the most common debugging problems, including memory corruption, resource leaks, stack problems, release build problems, finding crash locations, and multithreading problems.
These essential topics are covered:
- The debugging process
- Writing C++ code for debugging
- Strategically using assertions, trace statements, and exceptions
- Windows postmortem debugging using Dr. Watson and MAP files
- Using the Visual C++ debugger
- Debugging memory
- Debugging multithreaded programs
- Debugging COM
Each chapter provides developers with exactly what they need to master the subject and improve development productivity and software quality.
Comprehensive, current, and practical, Debugging Windows Programs helps developers understand the debugging process and make the most of the Visual C++ debugging tools.
Table of Contents
Answers to Frequently Asked Questions.
Preface.
Introduction.I. DEBUGGING STRATEGIES.
1. The Debugging Process.
The Five (Wrong) Stages of Debugging.
The Five Stages of Debugging.
Determining That a Bug Exists.
Gathering Bug Information.
Analyzing the Bug Information.
Removing the Bug.
Verifying the Change.
Debug Smarter, Not Harder.2. Writing C++ Code for Debugging.
Design.
C++ Programming Style.
The C++ Language.
The Visual C++ Compiler.3. Using Assertions.
The Limitations of Assertions.
Types of Assertions.
More MFC Assertion Macros.
Custom Assertions.
Portable Assertions.
Assertion Strategy.
Invariants.
Assertion Patterns.
Document Your Assertions.
Implementing AssertValid.
Defensive Programming.
Error Handling.
Miscellaneous Tips.4. Using Trace Statements.
Types of Trace Statements.
Custom Trace Statements.
Trace Statement Strategies.
Miscellaneous Tips.5. Using Exceptions and Return Values.
Incorrect Error Handling Results in Bugs.
The Need for a Strategy.
Using Exceptions.
Using Return Values.
Exceptions and Bugs.
C++ Exceptions versus Windows Structured Exception Handling.
Translating Structured Exceptions to C++ Exceptions.
Exception Performance.
Exception Strategy.
Defensive Programming with Exceptions.
Debugging Exceptions.
Miscellaneous Tips.
II. DEBUGGING TOOLS.
6. Debugging with Windows.
Postmortem Debugging.
Windows API Error Codes.
Windows Exception Basics.
Portable Executable Basics.
Rebasing DLLs.
Assembly Language Basics.
Debugging with MAP Files.
Debugging with PDB Files.
Debugging Using a Windows 98 Crash Dialog Box.
Debugging Using Dr. Watson.
Miscellaneous Tips.7. Debugging with the Visual C++ Debugger.
Compiler and Linker Options.
Debug versus Release Builds.
Debugging Release Builds.
The Test Build.
Debugging Symbols.
The Debug Windows.
Watch Expressions.
Datatip Expressions.
Registers and Pseudo-registers.
Watch Window Formatting Symbols.
Using Autoexp.dat.
Debugging with Breakpoints.
Just-in-time Debugging.
Remote Debugging.
Debugging with Edit and Continue.
III. DEBUGGING TECHNIQUES.
8. Basic Debugging Techniques.
General Debugging Techniques.
Visual C++ Debugger Techniques.
Windows Debugging Techniques.
MFC Debugging Techniques.9. Debugging Memory.
Why Memory Leaks Aren't Acceptable.
Types of Memory Debugging.
Using the Debug Heap.
How the Debug Heap Works.
Reading Windows Memory Addresses.
Debugging Memory Corruption.
Debugging Memory Leaks.
Debugging Windows Resource Leaks.
Debugging Windows Thread Stacks.
Miscellaneous Tips.10. Debugging Multithreaded Programs.
What Is Multithreading?
Issues in Multithreaded Programs.
Writing Thread-safe Code.
Thread Creation and Termination.
Understanding the Debugger.
Debugging Techniques.11. COM Debugging.
Chapter Basics.
Defensive COM Programming Practices.
Debugging Base COM DLLs.
Debugging Base COM EXEs.
Debugging Configured Components.
Debugging Base COM DLLs That Are Called From ASPs.12. Desperate Measures.
Checking the Easy Stuff.
Using Your Head.
Rechecking Your Assumptions.
Checking the Obvious.
Checking the Code.
Checking the System.
Double-Checking the Documentation.
Using Other People.
Using Newsgroups.
Stop Living Dangerously.Bibliography.
Index.
商品描述(中文翻譯)
摘要
對於專業軟體開發人員來說,除錯是一種生活方式。本書是 Windows 除錯的權威指南,為開發人員提供了他們需要的策略和技術,以有效且高效地履行他們最重要的責任之一。
《除錯 Windows 程式》向讀者展示如何通過充分利用 Visual C++ 開發工具來防止錯誤,並以某種方式編寫代碼,使某些類型的錯誤變得不可能。他們還將學習如何使用除錯語句來揭示錯誤,這些語句在程式執行時強迫錯誤暴露出來,以及如何充分利用 Windows、Visual C++、MFC 和 ATL 中可用的除錯工具和功能。作者提供了針對最常見的除錯問題的具體解決方案,包括記憶體損壞、資源洩漏、堆疊問題、發佈版本問題、查找崩潰位置和多執行緒問題。
這些基本主題包括:
- 除錯過程
- 為除錯編寫 C++ 代碼
- 策略性使用斷言、追蹤語句和例外
- 使用 Dr. Watson 和 MAP 檔案進行 Windows 死後除錯
- 使用 Visual C++ 除錯器
- 除錯記憶體
- 除錯多執行緒程式
- 除錯 COM
每一章都為開發人員提供了他們掌握主題和提高開發生產力及軟體質量所需的內容。
全面、最新且實用的《除錯 Windows 程式》幫助開發人員理解除錯過程,並充分利用 Visual C++ 除錯工具。
目錄
常見問題解答。前言。導言。
I. 除錯策略。
1. 除錯過程。
- 除錯的五個(錯誤)階段。
- 除錯的五個階段。
- 確定存在錯誤。
- 收集錯誤資訊。
- 分析錯誤資訊。
- 移除錯誤。
- 驗證變更。
- 更聰明地除錯,而不是更辛苦地除錯。
2. 為除錯編寫 C++ 代碼。
- 設計。
- C++ 程式風格。
- C++ 語言。
- Visual C++ 編譯器。
3. 使用斷言。
- 斷言的限制。
- 斷言的類型。
- 更多 MFC 斷言宏。
- 自定義斷言。
- 可攜式斷言。
- 斷言策略。
- 不變式。
- 斷言模式。
- 記錄你的斷言。
- 實現 AssertValid。
- 防禦性編程。
- 錯誤處理。
- 其他提示。
4. 使用追蹤語句。
- 追蹤語句的類型。
- 自定義追蹤語句。
- 追蹤語句策略。
- 其他提示。
5. 使用例外和返回值。
- 錯誤處理不當導致錯誤。
- 需要策略。
- 使用例外。
- 使用返回值。
- 例外與錯誤。
- C++ 例外與 Windows 結構化例外處理。
- 將結構化例外轉換為 C++ 例外。
- 例外性能。
- 例外策略。
- 使用例外的防禦性編程。
- 除錯例外。
- 其他提示。
II. 除錯工具。
6. 使用 Windows 進行除錯。
- 死後除錯。
- Windows API 錯誤代碼。
- Windows 例外基礎知識。
- 可攜式可執行檔基礎知識。
- 重新基底 DLL。
- 組合語言基礎知識。
- 使用 MAP 檔案進行除錯。
- 使用 PDB 檔案進行除錯。
- 使用 Windows 98 崩潰對話框進行除錯。
- 使用 Dr. Watson 進行除錯。
- 其他提示。
7. 使用 Visual C++ 除錯器進行除錯。
- 編譯器和連結器選項。
- 除錯版本與發佈版本。
- 除錯發佈版本。
- 測試版本。
- 除錯符號。
- 除錯窗口。
- 監視表達式。
- 數據提示表達式。
- 寄存器和偽寄存器。
- 監視窗口格式符號。
- 使用 Autoexp.dat。
- 使用斷點進行除錯。
- 即時除錯。
- 遠端除錯。
- 使用編輯和繼續進行除錯。
III. 除錯技術。
8. 基本除錯技術。
- 一般除錯技術。
- Visual C++ 除錯器技術。
- Windows 除錯技術。
- MFC 除錯技術。
9. 除錯記憶體。
- 為什麼記憶體洩漏不可接受。
- 記憶體除錯的類型。
- 使用除錯堆。
- 除錯堆的工作原理。
- 讀取 Windows 記憶體地址。
- 除錯記憶體損壞。
- 除錯記憶體洩漏。
- 除錯 Windows 資源洩漏。
- 除錯 Windows 執行緒堆疊。
- 其他提示。
10. 除錯多執行緒程式。
- 什麼是多執行緒?
- 多執行緒程式中的問題。
- 編寫執行緒安全的代碼。
- 執行緒的創建和終止。
- 理解除錯器。
- 除錯技術。
11. COM 除錯。
- 章節基礎知識。
- 防禦性 COM 編程實踐。
- 除錯基礎 COM DLL。
- 除錯基礎 COM EXE。
- 除錯配置的組件。
- 除錯從 ASP 調用的基礎 COM DLL。
12. 絕望的措施。
- 檢查簡單的東西。
- 使用你的頭腦。
- 重新檢查你的假設。
- 檢查明顯的東西。
- 檢查代碼。
- 檢查系統。
- 重新檢查文檔。
- 使用其他人。
- 使用新聞組。
- 停止危險的生活。
參考書目。索引。