logo资料库

Effective.Debugging.66.Specific.Ways.to.Debug.Software.and.Syste....pdf

第1页 / 共257页
第2页 / 共257页
第3页 / 共257页
第4页 / 共257页
第5页 / 共257页
第6页 / 共257页
第7页 / 共257页
第8页 / 共257页
资料共257页,剩余部分请下载后查看
Cover
Title Page
Copyright Page
Contents
Figures
Listings
Preface
Acknowledgments
About the Author
Chapter 1: High-LevelStrategies
Item 1: Handle All Problems through an Issue-Tracking System
Item 2: Use Focused Queries to Search the Web for Insights into Your Problem
Item 3: Confirm That Preconditions and Postconditions Are Satisfied
Item 4: Drill Up from the Problem to the Bug or Down from the Program’s Start to the Bug
Item 5: Find the Difference between a Known Good System and a Failing One
Item 6: Use the Software’s Debugging Facilities
Item 7: Diversify Your Build and Execution Environment
Item 8: Focus Your Work on the Most Important Problems
Chapter 2: General-Purpose Methods and Practices
Item 9: Set Yourself Up for Debugging Success
Item 10: Enable the Efficient Reproduction of the Problem
Item 11: Minimize the Turnaround Time from Your Changes to Their Result
Item 12: Automate Complex Testing Scenarios
Item 13: Enable a Comprehensive Overview of Your Debugging Data
Item 14: Consider Updating Your Software
Item 15: Consult Third-Party Source Code for Insights on Its Use
Item 16: Use Specialized Monitoring and Test Equipment
Item 17: Increase the Prominence of a Failure’s Effects
Item 18: Enable the Debugging of Unwieldy Systems from Your Desk
Item 19: Automate Debugging Tasks
Item 20: Houseclean Before and After Debugging
Item 21: Fix All Instances of a Problem Class
Chapter 3: General-Purpose Tools and Techniques
Item 22: Analyze Debug Data with Unix Command-Line Tools
Item 23: Utilize Command-Line Tool Options and Idioms
Item 24: Explore Debug Data with Your Editor
Item 25: Optimize Your Work Environment
Item 26: Hunt the Causes and History of Bugs with the Revision Control System
Item 27: Use Monitoring Tools on Systems Composed of Independent Processes
Chapter 4: Debugger Techniques
Item 28: Use Code Compiled for Symbolic Debugging
Item 29: Step through the Code
Item 30: Use Code and Data Breakpoints
Item 31: Familiarize Yourself with Reverse Debugging
Item 32: Navigate along the Calls between Routines
Item 33: Look for Errors by Examining the Values of Variables and Expressions
Item 34: Know How to Attach a Debugger to a Running Process
Item 35: Know How to Work with Core Dumps
Item 36: Tune Your Debugging Tools
Item 37: Know How to View Assembly Code and Raw Memory
Chapter 5: Programming Techniques
Item 38: Review and Manually Execute Suspect Code
Item 39: Go Over Your Code and Reasoning with a Colleague
Item 40: Add Debugging Functionality
Item 41: Add Logging Statements
Item 42: Use Unit Tests
Item 43: Use Assertions
Item 44: Verify Your Reasoning by Perturbing the Debugged Program
Item 45: Minimize the Differences between a Working Example and the Failing Code
Item 46: Simplify the Suspect Code
Item 47: Consider Rewriting the Suspect Code in Another Language
Item 48: Improve the Suspect Code’s Readability and Structure
Item 49: Fix the Bug’s Cause, Rather Than Its Symptom
Chapter 6: Compile-Time Techniques
Item 50: Examine Generated Code
Item 51: Use Static Program Analysis
Item 52: Configure Deterministic Builds and Executions
Item 53: Configure the Use of Debugging Libraries and Checks
Chapter 7: Runtime Techniques
Item 54: Find the Fault by Constructing a Test Case
Item 55: Fail Fast
Item 56: Examine Application Log Files
Item 57: Profile the Operation of Systems and Processes
Item 58: Trace the Code’s Execution
Item 59: Use Dynamic Program Analysis Tools
Chapter 8: Debugging Multi-threaded Code
Item 60: Analyze Deadlocks with Postmortem Debugging
Item 61: Capture and Replicate
Item 62: Uncover Deadlocks and Race Conditions with Specialized Tools
Item 63: Isolate and Remove Nondeterminism
Item 64: Investigate Scalability Issues by Looking at Contention
Item 65: Locate False Sharing by Using Performance Counters
Item 66: Consider Rewriting the Code Using Higher-Level Abstractions
Web Resources
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
Y
Z
ptg18240117
i i “effective-debugging” — 2016/6/3 — 14:32 — page i — #1 i i Effective Debugging i i i i
i i “effective-debugging” — 2016/6/3 — 14:32 — page ii — #2 i i i i ptg18240117The Effective Software Development Series provides expert advice on all aspects of modern software development. Titles in the series are well written, technically sound, and of lasting value. Each describes the critical things experts always do — or always avoid — to produce outstanding software.Scott Meyers, author of the best-selling books Effective C++ (now in its third edition), More Effective C++, and Effective STL (all available in both print and electronic versions), conceived of the series and acts as its consulting editor. Authors in the series work with Meyers to create essential reading in a format that is familiar and accessible for software developers of every stripe.Visit informit.com/esds for a complete list of available publications.Make sure to connect with us!informit.com/socialconnectThe Effective Software Development SeriesScott Meyers, Consulting Editor
i i “effective-debugging” — 2016/6/3 — 14:32 — page iii — #3 i i Effective Debugging 66 SPECIFIC WAYS TO DEBUG SOFTWARE AND SYSTEMS Diomidis Spinellis Boston Columbus Indianapolis New York San Francisco Amsterdam Cape Town Dubai London Madrid Milan Munich Paris Montreal Toronto Delhi Mexico City São Paulo Sydney Hong Kong Seoul Singapore Taipei Tokyo i i i i ptg18240117
i i “effective-debugging” — 2016/6/3 — 14:32 — page iv — #4 i i 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 publisher was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals. The author 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 omissions. 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. For information about buying this title in bulk quantities, or for special sales opportunities (which may include electronic versions; custom cover designs; and content particular to your business, training goals, marketing focus, or branding interests), please contact our corporate sales department at corpsales@pearsoned.com or (800) 382-3419. For government sales inquiries, please contact governmentsales@pearsoned.com. For questions about sales outside the U.S., please contact intlcs@pearson.com. Visit us on the Web: informit.com/aw Library of Congress Control Number: 2016937082 Copyright © 2017 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 permissions, request forms, and the appropriate contacts within the Pearson Education Global Rights & Permissions Department, please visit www.pearsoned.com/permissions/. ISBN-13: 978-0-13-439479-4 ISBN-10: 0-13-439479-8 Text printed in the United States at RR Donnelley in Crawfordsville, Indiana. First printing, July 2016 i i i i ptg18240117
i i “effective-debugging” — 2016/6/3 — 14:32 — page v — #5 i i To my mentors, past and future i i i i ptg18240117
This page intentionally left blank ptg18240117
i i “effective-debugging” — 2016/6/3 — 14:32 — page vii — #7 i i Contents Figures Listings Preface Acknowledgments About the Author xi xiii xv xxiii xxviii Chapter 1: High-Level Strategies Item 1: Handle All Problems through an Issue-Tracking System Item 2: Use Focused Queries to Search the Web for Insights into Your Problem Item 3: Confirm That Preconditions and Postconditions Are Satisfied Item 4: Drill Up from the Problem to the Bug or Down from the Program’s Start to the Bug Item 5: Find the Difference between a Known Good System and a Failing One Item 6: Use the Software’s Debugging Facilities Item 7: Diversify Your Build and Execution Environment Item 8: Focus Your Work on the Most Important Problems Chapter 2: General-Purpose Methods and Practices Item 9: Set Yourself Up for Debugging Success Item 10: Enable the Efficient Reproduction of the Problem 1 1 3 5 7 9 12 17 20 23 23 25 i i i i ptg18240117
分享到:
收藏