Synopses & Reviews
Use Windows debuggers throughout the development cycle—and build better software Rethink your use of Windows debugging and tracing tools—and learn how to make them a key part of test-driven software development. Led by a member of the Windows Fundamentals Team at Microsoft, you’ll apply expert debugging and tracing techniques—and sharpen your C++ and C# code analysis skills—through practical examples and common scenarios. Learn why experienced developers use debuggers in every step of the development process, and not just when bugs appear.
Discover how to:
- Go behind the scenes to examine how powerful Windows debuggers work
- Catch bugs early in the development cycle with static and runtime analysis tools
- Gain practical strategies to tackle the most common code defects
- Apply expert tricks to handle user-mode and kernel-mode debugging tasks
- Implement postmortem techniques such as JIT and dump debugging
- Debug the concurrency and security aspects of your software
- Use debuggers to analyze interactions between your code and the operating system
- Analyze software behavior with Xperf and the Event Tracing for Windows (ETW) framework
Synopsis
Through a combination of best practices and common debugging and programming techniques—several of which are not currently documented in other books—this book shows developers why the system works the way it does and not simply what it does or how it does it.
During the course of this book, readers will:
- Learn how to use debuggers as an integral part of the development process iterations
- Leverage the power of debuggers to learn system internals and mechanics
- Dissect software behavior on Windows using tracing and debugging tools
- Apply the above strategies to enhance knowledge of a few key fundamental topics in Windows
Synopsis
Expand your knowledge of system internals—and get a solid grounding in Windows® debugging tools
Dive deep into the internals and programming interfaces of the Windows platform—and learn best practices for using common debugging and programming techniques. Led by a member of the Windows Fundamentals Team at Microsoft®, youll explore system internals and learn exactly why Windows works the way it does. Increase your expertise of this platform and discover ways to help make Windows frameworks more accessible.
Discover how to:
- Apply best practices and common debugging and programming techniques
- Use Windows debugging tools as an integral part of iterations in the development process
- Leverage the power of debuggers to learn system internals and mechanics
- Use tracing and debugging tools to dissect software behavior on Windows
- Understand the foundations of the Windows operating system architecture
About the Author
Tarik Soulami is a principal development lead on the Windows Fundamentals Team at Microsoft.
Table of Contents
Foreword; Introduction; Who Should Read This Book; Organization of This Book; Conventions in This Book; System Requirements; Code Samples; Acknowledgments; Errata & Book Support; We Want to Hear from You; Stay in Touch; Part 1: A Bit of Background; Chapter 1: Software Development in Windows; 1.1 Windows Evolution; 1.2 Windows Architecture; 1.3 Windows Developer Interface; 1.4 Microsoft Developer Tools; 1.5 Summary; Part 2: Debugging for Fun and Profit; Chapter 2: Getting Started; 2.1 Introducing the Debugging Tools; 2.2 User-Mode Debugging; 2.3 Kernel-Mode Debugging; 2.4 Summary; Chapter 3: How Windows Debuggers Work; 3.1 User-Mode Debugging; 3.2 Kernel-Mode Debugging; 3.3 Managed-Code Debugging; 3.4 Script Debugging; 3.5 Remote Debugging; 3.6 Summary; Chapter 4: Postmortem Debugging; 4.1 Just-in-Time Debugging; 4.2 Dump Debugging; 4.3 Summary; Chapter 5: Beyond the Basics; 5.1 Noninvasive Debugging; 5.2 Data Breakpoints; 5.3 Scripting the Debugger; 5.4 WOW64 Debugging; 5.5 Windows Debugging Hooks (GFLAGS); 5.6 Summary; Chapter 6: Code Analysis Tools; 6.1 Static Code Analysis; 6.2 Runtime Code Analysis; 6.3 Summary; Chapter 7: Expert Debugging Tricks; 7.1 Essential Tricks; 7.2 More Useful Tricks; 7.3 Kernel-Mode Debugging Tricks; 7.4 Summary; Chapter 8: Common Debugging Scenarios, Part 1; 8.1 Debugging Access Violations; 8.2 Debugging Heap Corruptions; 8.3 Debugging Stack Corruptions; 8.4 Debugging Stack Overflows; 8.5 Debugging Handle Leaks; 8.6 Debugging User-Mode Memory Leaks; 8.7 Debugging Kernel-Mode Memory Leaks; 8.8 Summary; Chapter 9: Common Debugging Scenarios, Part 2; 9.1 Debugging Race Conditions; 9.2 Debugging Deadlocks; 9.3 Debugging Access-Check Problems; 9.4 Summary; Chapter 10: Debugging System Internals; 10.1 The Windows Console Subsystem; 10.2 Anatomy of System Calls; 10.3 Summary; Part 3: Observing and Analyzing Software Behavior; Chapter 11: Introducing Xperf; 11.1 Acquiring Xperf; 11.2 Your First Xperf Investigation; 11.3 Xperfs Strengths and Limitations; 11.4 Summary; Chapter 12: Inside ETW; 12.1 ETW Architecture; 12.2 Existing ETW Instrumentation in Windows; 12.3 Understanding ETW Stack-Walk Events; 12.4 Adding ETW Logging to Your Code; 12.5 Boot Tracing in ETW; 12.6 Summary; Chapter 13: Common Tracing Scenarios; 13.1 Analyzing Blocked Time; 13.2 Analyzing Memory Usage; 13.3 Tracing as a Debugging Aid; 13.4 Summary; WinDbg User-Mode Debugging Quick Start; Starting a User-Mode Debugging Session; Fixing the Symbols Path; Fixing the Sources Path; Displaying the Command Line of the Target Process; Control Flow Commands; Listing Loaded Modules and Their Version; Resolving Function Addresses; Setting Code (Software) Breakpoints; Setting Data (Hardware) Breakpoints; Switching Between Threads; Displaying Call Stacks; Displaying Function Parameters; Displaying Local Variables; Displaying Data Members of Native Types; Navigating Between Call Frames; Listing Function Disassembly; Displaying and Modifying Memory and Register Values; Ending a User-Mode Debugging Session; WinDbg Kernel-Mode Debugging Quick Start; Starting a Kernel-Mode Debugging Session; Switching Between CPU Contexts; Displaying Process Information; Displaying Thread Information; Switching Process and Thread Contexts; Listing Loaded Modules and Their Version; Setting Code (Software) Breakpoints Inside Kernel-Mode Code; Setting Code (Software) Breakpoints Inside User-Mode Code; Setting Data (Hardware) Breakpoints; Ending a Kernel-Mode Debugging Session;