Codewarrior® Debugger Manual
Total Page:16
File Type:pdf, Size:1020Kb
CodeWarrior¨ Debugger Manual Because of last-minute changes to CodeWarrior, some of the information in this manual may be inaccurate. Please read the Release Notes on the CodeWarrior CD for the latest up-to-date information. Metrowerks CodeWarrior copyright ©1993Ð1997 by Metrowerks Inc. and its licensors. All rights reserved. Documentation stored on the compact disk(s) may be printed by licensee for personal use. Except for the foregoing, no part of this documentation may be reproduced or transmitted in any form by any means, electronic or mechanical, including photocopying, recording, or any information storage and retrieval system, without permission in writing from Metrowerks Inc. Metrowerks, the Metrowerks logo, CodeWarrior, and Software at Work are registered trademarks of Metrowerks Inc. PowerPlant and PowerPlant Constructor are trademarks of Metrowerks Inc. All other trademarks and registered trademarks are the property of their respective owners. ALL SOFTWARE AND DOCUMENTATION ON THE COMPACT DISK(S) ARE SUB- JECT TO THE LICENSE AGREEMENT IN THE CD BOOKLET. How to Contact Metrowerks: U.S.A. and international Metrowerks Corporation 2201 Donley Drive, Suite 310 Austin, TX 78758 U.S.A. Canada Metrowerks Inc. 1500 du College, Suite 300 Ville St-Laurent, QC Canada H4L 5G6 Mail order Voice: (800) 377Ð5416 Fax: (512) 873Ð4901 World Wide Web http://www.metrowerks.com Registration information [email protected] Technical support [email protected] Sales, marketing, & licensing [email protected] CompuServe goto Metrowerks Table of Contents 1 Introduction . .9 Overview of the Debugger Manual . 9 Read the Release Notes . 10 WhatÕs New . 10 System Requirements . 10 Installing MW Debug . 11 Starting Points . 11 Where to Learn More . 12 2 Getting Started. 13 Getting Started Overview . 13 Preparing for Debugging . 13 Setting Up a Project for Debugging . 13 Setting Up a File for Debugging . 14 Launching the Debugger . 15 Launching the Debugger from a Project . 16 Launching the Debugger Directly . 16 Symbolics Files . 17 SYM File Names . 18 Matching the SYM File to an Executable File . 18 CodeView Symbols . 18 3 What You See . 19 What You See Overview . 19 Program Window. 19 Stack Crawl Pane. 21 Variables Pane . 21 Debugger Control Buttons. 23 Source Pane . 23 Viewing source code as assembly . 24 Function Pop-up Menu . 26 Browser Window . 27 File Pane . 28 Function Pane . 30 Debugger Manual DBÐ3 Table of Contents Globals Pane. 31 Placing globals in a separate window . 31 Browser Source Pane . 32 Function Pop-up Menu . 33 Expression Window. 33 Breakpoint Window. 35 Log Window . 35 Variable Window . 36 Array Window . 37 Memory Window . 39 Register Windows . 40 Process Window . 41 4 Basic Debugging. 43 Basic Debugging Overview . 43 Starting Up . 44 Running, Stepping, and Stopping Code . 45 The Current-Statement Arrow . 47 Running Your Code . 47 Stepping a Single Line . 49 Stepping Into Routines . 50 Stepping Out of Routines . 51 Skipping Statements . 51 Stopping Execution. 53 Killing Execution. 53 Navigating Code . 54 Linear Navigation . 54 Call-Chain Navigation . 55 Browser Window Navigation . 56 Using the Find Dialog. 59 Breakpoints . 61 Setting Breakpoints . 61 Clearing Breakpoints . 62 Temporary Breakpoints . 62 Viewing Breakpoints . 63 Conditional Breakpoints . 64 DBÐ4 Debugger Manual Table of Contents Viewing and Changing Data . 65 Viewing Local Variables. 65 Viewing Global Variables . 66 Putting Data in a New Window . 67 Viewing Data Types . 68 Viewing Data in a Different Format . 69 Viewing Data as Different Types . 70 Changing the Value of a Variable . 72 Using the Expression Window . 73 Viewing Raw Memory . 74 Viewing Memory at an Address . 74 Viewing Processor Registers . 76 5 Expressions . 79 Expressions Overview. 79 In the Expression Window. 79 In the Breakpoint Window. 80 In a Memory Window. 81 Using Expressions . 82 Special Expression Features . 82 Expression Limitations . 82 Example Expressions . 84 Expression Syntax . 86 6 Debugger Preferences . 91 Debugger Preferences Overview . 91 Settings & Display . 92 Save settings in local Ò.dbgÓ Þles . 92 Save breakpoints. 92 Save expressions . 93 In variable panes, show variable types by default . 93 Sort functions by method name in browser . 93 Default size for unbound arrays . 93 Symbolics . 93 Use temporary memory for SYM data . 94 At startup, prompt for SYM Þle if none speciÞed . 94 Debugger Manual DBÐ5 Table of Contents Always prompt for source Þle location if Þle not found . 95 Ignore Þle modiÞcation dates . 95 Open all class Þles in directory hierarchy . 95 Program Control . 95 Automatically launch applications when SYM Þle opened. 96 ConÞrm ÒKill ProcessÓ when closing or quitting . 96 Stop at program main when launching applications . 97 Select stack crawl window when task is stopped . 97 DonÕt step into runtime support code . 97 Win32 Settings . 97 Java Settings . 99 Runtime Settings . 99 7 Debugger Menus. 103 Debugger Menus Overview . 103 Help menu. 103 File Menu . 103 Open . 104 Close . 104 Edit Þlename . 105 Save . 105 Save As. 105 Save Settings . 105 Quit . 105 Edit Menu . 106 Undo. 106 Cut . 106 Copy . 106 Paste . 106 Clear . 106 Select All . 106 Find . 107 Find Next . 107 Find Selection . 107 Preferences . 107 Control Menu . 107 DBÐ6 Debugger Manual Table of Contents Run . 108 Stop . 108 Kill. 108 Step Over . 108 Step Into . 109 Step Out . 109 Clear All Breakpoints. 109 Break on C++ exception. 110 Data Menu. 110 Show Types . 110 Expand . 110 Collapse All . 110 New Expression . 110 Open Variable Window . 111 Open Array Window . 111 Copy to Expression . ..