logo资料库

Advanced Windows Debugging 无水印pdf.pdf

第1页 / 共839页
第2页 / 共839页
第3页 / 共839页
第4页 / 共839页
第5页 / 共839页
第6页 / 共839页
第7页 / 共839页
第8页 / 共839页
资料共839页,剩余部分请下载后查看
Advanced Windows Debugging
Contents
Foreword
Preface
Acknowledgements
About the Authors
PART I: OVERVIEW
Chapter 1: Introduction to the Tools
Leak Diagnosis Tool
Debugging Tools for Windows
UMDH
Microsoft Application Verifier
Global Flags
Process Explorer
Windows Driver Kits
Ethereal
DebugDiag
Summary
Chapter 2 Introduction to the Debuggers
Debugger Basics
Basic Debugger Tasks
Remote Debugging
Debugging Scenarios
Summary
Chapter 3 Debuggers Uncovered
User Mode Debugger Internals
Controlling the Target
Summary
Chapter 4: Managing Symbol and Source Files
Managing the Symbols for Debugging
Managing Source Files for Debugging
Summary
PART II: APPLIED DEBUGGING
Chapter 5: Memory Corruption Part I—Stacks
Memory Corruption Detection Process
Stack Corruptions
Summary
Chapter 6: Memory Corruption Part II—Heaps
What Is a Heap?
Heap Corruptions
Summary
Chapter 7: Security
Windows Security Overview
Source of Security Information
How Is the Security Check Performed?
Identity Propagation in Client-Server Applications
Security Checks at System Boundaries
Investigating Security Failures
Summary
Chapter 8: Interprocess Communication
Communication Mechanisms
Troubleshooting Local Communication
Troubleshooting Remote Communication
Additional Technical Information
Summary
Chapter 9: Resource Leaks
What Is a Resource?
High-Level Process
Reproducibility of Resource Leaks
Handle Leaks
Memory Leaks
Summary
Chapter 10: Synchronization
Synchronization Basics
High-Level Process
Synchronization Scenarios
Summary
PART III: ADVANCED TOPICS
Chapter 11: Writing Custom Debugger Extensions
Introduction to Debugger Extensions
Example Debugger Extension
Summary
Chapter 12: 64-Bit Debugging
Microsoft 64-Bit Systems
Windows x64 Changes
Summary
Chapter 13: Postmortem Debugging
Dump File Basics
Using Dump Files
Windows Error Reporting
Corporate Error Reporting
Summary
Chapter 14: Power Tools
Debug Diagnostic Tool
!analyze Extension Command
Summary
Chapter 15: Windows Vista Fundamentals
Chapter 1—Introduction to the Tools
Chapter 2—Introduction to the Debuggers
Chapter 6—Memory Corruptions—Part Heaps
Chapter 7—Security
Chapter 8—Interprocess Communication
Chapter 9—Resource Leaks
Chapter 10—Synchronization
Chapter 11—Writing Custom Debugger Extensions
Chapter 13—Postmortem Debugging
Summary
Appendix A: Application Verifier Test Settings
Exceptions
Handles
Heaps
Locks
Memory
ThreadPool
TLS
FilePaths
HighVersionLie
InteractiveServices
KernelModeDriverInstall
Low Resource Simulation
LuaPriv
DangerousAPIs
DirtyStacks
TimeRollOver
PrintAPI and PrintDriver
Index
A
B
C
D
E
F
G
H
I–J
K
L
M
N
O
P
Q–R
S
T
U
V
W
X–Z
“Who says you can’t bottle experience? Between the covers is a wealth of information that clearly demonstrates how to take a logical approach to finding and eliminating bugs. This is an absolute must-have book for anyone who develops, tests, or supports software for Microsoft Windows.” —Bob Wilton, Escalation Engineer, Critical Problem Resolution Team, Microsoft Corporation “I have been fortunate enough to personally work with the authors on extremely demand- ing systems projects for more than eight years. This volume contains the kind of stuff we all wish we had known back at the beginning of those projects—the kind of stuff that the debugging guru tells you over a coffee-spilled keyboard on February 29 only because an extra day showed up and he has the afternoon free; the kind of stuff that only comes from actually building and then debugging complex systems projects instead of just read- ing about somebody else doing it. “Most books leave the advanced cases as ‘exercises to the reader’ or to ‘other, more advanced books,’ and those never seem to materialize. This book is one of those very rare ‘other’ books. Get two copies. You will always be lending the other one out.” —Raymond McCollum, Architect, Microsoft Forefront Security Products “This book by Microsoft authors Mario and Daniel is an excellent reference for both intermediate and advanced debuggers. In-depth examples showing how to debug intri- cate problems, such as stack and heap corruptions, make this book stand out among cur- rent available literature on debugging Win32 software on Windows. The book is highly practical and is filled with numerous debugging tricks and strategies.” —Kinshuman, Development Lead, Windows Core OS Division “I am pleased to see this guided tour through a comprehensive set of clever debugging techniques. It does not only tell how to deal with tough diagnosis problems, but it also explains the mechanisms behind the techniques used. The pragmatic approach taken in Advanced Windows Debugging makes it a good resource to understand several key Windows areas.” —Adrian Marinescu, Software Architect, Microsoft Corporation
“Advanced Windows Debugging fills the need for good documentation about debugging and fixing software defects. The book is based on the authors’ valuable experience of tracking down the cause of various classes of software bugs. It includes representative examples of typical defects, the tools used to investigate these defects, and step-by-step instructions for using these tools. Software developers and testers will greatly benefit from becoming familiar with these examples.” —Daniel Mihai, Software Design Engineer, Developer Productivity Tools, Microsoft “I wrote the WinDbg symbol handler, Symbol Server, and Source Server. Even so, I can’t get my own wife to use WinDbg. She thinks it is hard to use, and, consequently, she hasn’t learned of the potential of this toolset. I am buying a copy of this book, so she can learn it. The chapters on postmortem debugging and memory corruption are essential reading that provide real insight into the internals of the runtime and OS in the context of a program fault. Mario and Daniel’s understanding of debugging comes from being asked to resolve completely unexplained bugs in unfamiliar target programs. This is what industrial strength debugging is all about.” —Pat Styles, Microsoft
ADVANCED WINDOWS DEBUGGING
This page intentionally left blank
ADVANCED WINDOWS DEBUGGING Mario Hewardt Daniel Pravat Upper Saddle River, NJ • Boston • Indianapolis • San Francisco New York • Toronto • Montreal • London • Munich • Paris • Madrid Cape Town • Sydney • Tokyo • Singapore • Mexico City
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and the pub- lisher was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals. The authors and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omis- sions. No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein. The publisher offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales, which may include electronic versions and/or custom covers and content particular to your business, training goals, marketing focus, and branding interests. For more information, please contact: U.S. Corporate and Government Sales (800) 382-3419 corpsales@pearsontechgroup.com For sales outside the United States please contact: International Sales international@pearsoned.com Editor-in-Chief Karen Gettman Acquisitions Editor Joan Murray Senior Development Editor Chris Zahn Managing Editor Gina Kanouse Copy Editor Rhonda Tinch-Mize Indexer Brad Herriman Proofreader Karen A. Gill Editorial Assistant Kim Boedigheimer Cover Designer Chuti Prasertsith Composition TnT Design Visit us on the Web: www.awprofessional.com Library of Congress Cataloging-in-Publication Data: Hewardt, Mario. Advanced windows debugging / Mario Hewardt, Daniel Pravat. p. cm. Includes index. ISBN 0-321-37446-0 (pbk. : alk. paper) 1. Microsoft Windows (Computer file) 2. Operating systems (Computers)— Management. 3. Debugging in computer science. I. Pravat, Daniel. II. Title. QA76.76.O63H497 2007 005.4’46—dc22 2007030163 Copyright © 2008 Pearson Education, Inc. All rights reserved. Printed in the United States of America. This publication is protected by copyright, and permission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permis- sions, write to: Pearson Education, Inc. Rights and Contracts Department 501 Boylston Street, Suite 900 Boston, MA 02116 Fax (617) 671 3447 This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later. (The latest version is presently available at http://www.opencontent.org/openpub/.) ISBN-13: 978-0-321-37446-2 ISBN-10: 0-321-37446-0 Text printed in the United States on recycled paper at Edwards Brothers in Ann Arbor, Michigan. First printing October 2007.
To my wife Pia, whose support, patience, and encouragement helped make this book a reality. To the familia who taught and encouraged me to follow my dreams and passions. Mario Hewardt To Claudia, Alexis, and Edward Daniel Pravat
分享到:
收藏