User's Guide Borland® Turbo Debugger
Total Page:16
File Type:pdf, Size:1020Kb
User's Guide Borland" o User's Guide Borland® Turbo Debugger® Borland'rntemational, Inc., 100 Borland Way P.O. Box 660001, Scotts Valley, CA 95067-0001 Borland may have patents and/or pending patent applications covering subject matter, in this document. The furnishing of this document does not give you any license to these patents. COPYRIGHT © 1988, 1995 Borland International. All rights reserved. All Borland product names are trademarks or registered trademarks of Borland International, Inc. Other brand and product names are trademarks or registered trademarks of their respective holders. Printed in the U.S.A. IEORI295 9596979899-9 8 7 6 5 4 HI Contents Introduction 1 Preparing programs for debugging . 15 Compiling from the C++ integrated New features and changes for version 5.x . .2 environment. 16 New features and changes for version 4.x . .2 Compiling from Delphi . 16 Hardware requirements. .2 Compiling from the command line . 16 Terminology in this manual. .3 Starting Turbo Debugger . 17 Module ....................... 3 Specifying Turbo Debugger's command-line Function ....................... 3 options ....................... 17 Turbo Debugger . 3 Setting command-line options with Turbo Typographic and icon conventions . 3 Debugger's icon properties . 18 Using this manual . .4 Setting command-line options from Borland's C++ integrated environment. .. 18 Where to now? . .5 Launching Turbo Debugger from Delphi ... 18 First-time Turbo Debugger users . 5 Running Turbo Debugger . .... 19 Experienced Turbo Debugger users ....... 5 Loading your program into the debugger . 19 Software registration and technical support . 5 Searching for source code. 21 Chapter 1 Specifying program arguments . 21 Restarting a debugging session . 21 Installing and configuring Just-in-time debugging. 22 Turbo Debugger 7 Controlling program execution. 23 Installing Turbo Debugger . 7 The Run menu. 23 Run ......................... 24 Configuring Turbo Debugger............ 7 Go to Cursor .................... 24 Turbo Debugger's configuration files. .8 Trace Into . 24 Searchffig for configuration files. 8 Step Over ..................... 24 Setting up the Windows video .DLLs .......9 Execute To. .............. 25 Dual-monitor debugging ..............9 Until Return. 25 The Options menu . .9 Animate ...................... 25 The Language command. 10 Back Trace. 25 Display Options command. 10 Instruction Trace ................. 25 Display Swapping. 10 Arguments. 26 Integer Format . 10 Program Reset. 26 Screen Lines ................... 11 Next Pending Status . 26 Tab Size ..................... 11 Waitfor Child ................... 27 Background Delay. 11 User Screen Delay . 11 Interrupting program execution . 27 Path for Source command . 11 Stopping in Windows code. 27 Save Options command. 12 Reverse execution. 27 Restore Options command. 12 The Execution History window Files installed with Turbo Debugger. 12 SpeedMenu . .. .............. 28 Inspect ..................... 28 Turbo Debugger's executable and . support files . 12 Reverse Execute. 28 Full History . 29 Turbo Debugger's utilities ............. 13 The Keystroke Recording pane . 29 Specifying utility command-line options. 14 The Keystroke Recording pane SpeedMenu. 29 Turbo Debugger's online text files. 14 Inspect . .' . 29 Chapter 2 Keystroke Restore. 29 Program termination ................ 30 Starting Turbo Debugger and Resetting your program. ./. 30 running your program 15 Exiting Turbo Debugger. .. 30 Chapter 3 The Get Info text box . 43 Debugging with Turbo Debug,ger 31 The Attach command. 44 The as Shell command. 45 Debugging basics. 31 Getting help. .'. 46 Discovering a bug . 31 Online help . 46 Isolating the bug . 32 The status line. 46 Finding the bug. 32 Fixing the bug. • . 32 Chapter 4 .What Turbo Debugger can do for you . 33 Setting and using breakpoints 49 Turbo Debugger's user interface. 33 Breakpoints defined . 49 Workffigwithmenus ............... 33 Breakpointlocations. 49 Workffig with windows .............. 34 Selecting a window . 34 Breakpoint conditions. 50 Using window panes . 34 Breakpoint actions. 50 Moving and resizing windows. ',' . 34 The Breakpoints window . 50 Closing and recovering windows. 35 The Breakpoints window SpeedMenu. 51 SpeedMenus. 35 Breakpoint types . 51 Turbo Debugger's windows . 35 Setting simple breakpoints. 51 The View menu's windows. 35 Setting expression-true breakpoints . 52 Breakpoints window . 35 Setting changed-memory breakpoints . 54 Stack window. '.' . 36 Setting global breakpoints . 55 Log window ... '. 36 Global breakpoint shortcuts . 55 Watches window. 36 Setting hardware breakpoints . 56 Variables window . 36 Breakpoint actions . .'. 56 Module window. 36 Break ......................... 57 File window. .. .'. 37 Execute ....................... 57 CPU window. 37 Log .......................... 57 Dump window. 37 Enable group. .. 57 Registers window . 37 Disable group.................... 57 Numeric Processor window . 37 Setting breakpoint conditions and actions . 58 Execution History window. 37 Creating breakpoint condition sets . 58 Hierarchy window. 38 Windows Messages window. 38 Creating breakpoint action sets . 58 Clipboard window. 38 Multiple condition and action sets . 59 Duplicating windows . 38 The scope of breakpoint expressions . 59 Other windows. '.' . .. 38 Breakpoint groups . 59 Inspector windows. 38 Creating breakpoint groups . 60 User screen . 39 Deleting breakpoint groups . 60 Turbo Debugger's special features. 39 Enabling and disabling breakpoint ' Automatic name completion . 39 groups. ~ . 60 Select by typing. 40 Navigating to a breakpoint location . 61 Incrementalmatching ............... 40 Enabling and disabling breakpoints ....... 61 Keyboard macros .. 40 Removing breakpoints. 61 The Macros menu . 40 Setting breakpoints on C++ templates ...... 61 Create . " . ; 40 Setting breakpoints on threads . 62 Stop Recording. 41 Remove . .'. 41 The Log window . 63 Delete All .................... 41 The Log window SpeedMenu. 63 The Clipboard. .. .'. 41 Open Log File . 63 The Pick dialog box . 41 Close Log File . ;, '. 64 The Clipboard window. 42 Logging. ,64 The Clipboard window SpeedMenu . 43 Add Comment. .64 Dynamic updating. 43 Erase Log. .. 64 Display Windows Info . 64 ii ChapterS Entering byte lists . 81 Examining and modifying data 65 Calling functions. 82 Expressions with side effects . 82 The Watches window . 65 Format specifiers . 83 Creating watches .................. 66 Accessing symbols outside the current The Watches window SpeedMenu . 67 scope .................. '......... 83 Watch ...................... 67 Edit ........................ 67 How Turbo Debugger searches for symbols ...................... 83 Remove ..................... 67 Delete All .................... 67 Implied scope for expression evaluation. 84 Inspect ...................... 67 . Scope override syntax. 84 Change ..................... 67 Overriding scope in C, C++, and assembler programs. 84 The Variables window. '. 67 Scope override examples using C. 85 The Variable window SpeedMenus. 68 Overriding scope in Object Pascal Inspect ...................... 68 programs. '. 86 Change ..................... 68 Scobe override examples using Watch ...................... 69 o ject Pascal. 86 Show ....................... 69 Scope and DLLs . 87 Viewing variables from the Stack window. 69 Inspector windows. 69 Chapter 7 Opening Inspector windows . 70 Examining disk files 89 Scalar Inspector windows. 70 Pointer Inspector windows . 71 Examining program source files . 89 C+-: Structure and Union Inspector Loading source files. 90 wmdows ...................... 71 The Module window SpeedMenu . 90 Object Pascal Record Inspector windows. 72 Inspect ..................... 90 Array Inspector windows. 72 Watch ...................... 91 Function Inspector windows . 73 Thread ..................... 91 Module ..................... 91 The' Inspector window SpeedMenu . 73 File ........................ 91 Range .. '.' .................. 73 Previous ...... : ............. 91 Change ..................... 74 Line ....................... 91 Inspect ...................... 74 Search ...................... 92 Descend ..................... 74 Next ....................... 92 New Expression ................ 74 Origin ...................... 92 Type Cast .......... ~ ......... 74 Goto ....................... 92 The Stack window . 74 Edit ....................... 92 The Stack window SpeedMenu . 75 Exceptions . 93 Inspect ...................... 75 Examining other disk files. 93 Locals ...................... 75 The File window SpeedMenu . 94 The Evaluate/Modify command......... 75 Goto ....................... 94 Evaluating C++ expressions . 76 Search ...................... 94 Evaluating Object Pascal expressions . 77 Next ....................... 94 Function Return command . .. 78 Display As . ; . 94 File ........................ 95 Chapter 6 Edit ....................... 95 Evaluating' expressions 79 Chapter 8 Turbo Debugger's expression evaluator . 79 Assembly-level debugging 97 Selecting an evaluator . 79 Expression limitations. 80 The CPU window. .. ..