Workshop: Command-Line Utilities

Workshop: Command-Line Utilities

WorkShop: Command-Line Utilities SunSoft, Inc. A Sun Microsystems, Inc. Business 2550 Garcia Avenue Mountain View, CA 94043 USA 415 960-1300 fax 415 969-9131 Part No.: 802-5763-10 Revision A, December 1996 Copyright 1996 Sun Microsystems, Inc., 2550 Garcia Avenue, Mountain View, California 94043-1100 U.S.A. All rights reserved. This product or document is protected by copyright and distributed under licenses restricting its use, copying, distribution, and decompilation. No part of this product or document may be reproduced in any form by any means without prior written authorization of Sun and its licensors, if any. Portions of this product may be derived from the UNIX® system, licensed from Novell, Inc., and from the Berkeley 4.3 BSD system, licensed from the University of California. UNIX is a registered trademark in the United States and other countries and is exclusively licensed by X/Open Company Ltd. Third-party software, including font technology in this product, is protected by copyright and licensed from Sun’s suppliers. RESTRICTED RIGHTS: Use, duplication, or disclosure by the U.S. Government is subject to restrictions of FAR 52.227- 14(g)(2)(6/87) and FAR 52.227-19(6/87), or DFAR 252.227-7015(b)(6/95) and DFAR 227.7202-3(a). Sun, Sun Microsystems, the Sun logo, SunSoft, Solaris, Sun OS, Sun WorkShop, Sun WorkShop TeamWare, Sun Performance WorkShop, Sun Visual WorkShop, LoopTool, LockLint, Thread Analyzer, Sun C, Sun C++, Sun FORTRAN, Answerbook, and SunExpress are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the United States and other countries. Products bearing SPARC trademarks are based upon an architecture developed by Sun Microsystems, Inc. The OPEN LOOK® and Sun™ Graphical User Interfaces were developed by Sun Microsystems, Inc. for its users and licensees. Sun acknowledges the pioneering efforts of Xerox in researching and developing the concept of visual or graphical user interfaces for the computer industry. Sun holds a non-exclusive license from Xerox to the Xerox Graphical User Interface, which license also covers Sun’s licensees who implement OPEN LOOK GUIs and otherwise comply with Sun’s written license agreements. THIS PUBLICATION IS PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. Please Recycle Contents Preface. xxi Part 1 —Using dbx 1. A dbx Overview . 3 2. Starting dbx . 5 Basic Concepts . 5 Starting a Debugging Session. 5 dbx Start-up Sequence . 6 If a Core File Exists . 6 Process ID . 7 Setting Startup Properties . 7 pathmap . 7 dbxenv . 8 alias . 8 Debugging Optimized Code. 8 Compiling with the -g Option. 9 iii Code Compiled Without the -g Option . 9 Shared Libraries Need -g for Full dbx Support . 9 C++ Support and the -g Option . 10 Completely Stripped Programs . 10 Quitting Debugging. 10 Stopping Execution . 10 Detaching a Process From dbx. 10 Killing a Program Without Terminating the Session. 11 Saving and Restoring a Debugging Run . 11 save . 11 Saving a Series of Debugging Runs as Checkpoints . 12 Restoring a Saved Run . 13 Saving and Restoring using replay. 14 Command Reference . 15 Syntax . 15 Start-up Options. 15 3. Viewing and Visiting Code . 17 Basic Concepts . 17 Mapping to the Location of the Code . 18 Visiting Code . 18 Visiting a File . 18 Visiting Functions . 19 Printing a Source Listing. 20 Walking the Call Stack to Visit Code . 20 iv WorkShop: Command-Line Utilities—December 1996 Qualifying Symbols with Scope Resolution Operators. 21 Backquote Operator. 21 C++ Double Colon Scope Resolution Operator . 21 Block Local Operator. 22 Linker Names . 22 Scope Resolution Search Path. 22 Locating Symbols. 23 Printing a List of Occurrences of a Symbol. 24 Determining Which Symbol dbx Uses . 24 Viewing Variables, Members, Types, and Classes . 25 Looking Up Definitions of Types and Classes . 27 Using the Auto-Read Facility . 29 Disabling Auto-Read with the -xs Compiler Option. 30 Listing Modules . 30 Command Reference . 31 modules . 31 whatis . 32 list . 32 4. Controlling Program Execution . 35 Basic Concepts . 35 Running a Program in dbx . 36 Attaching dbx to a Running Process . 36 Detaching a Process from dbx . 37 Executing a Program . 38 Contents v Calling a Function . 38 Continuing a Program. 39 Using Ctrl+C to Stop a Process . 40 Command Summary . 41 run. 41 rerun . 41 next . 41 cont . 42 step . 43 debug . 44 detach . 45 5. Examining the Call Stack. 47 Basic Concepts . 47 Finding Your Place on the Stack. 48 Walking the Stack and Returning Home. 48 Moving Up and Down the Stack . 48 Command Reference . 49 where . 49 hide/unhide . 50 6. Evaluating and Displaying Data . 51 Basic Concepts . 51 Evaluating Variables and Expressions. 51 Verifying Which Variable dbx Uses. 52 Variables Outside the Scope of the Current Function . 52 vi WorkShop: Command-Line Utilities—December 1996 Printing C++. 53 Dereferencing Pointers . 54 Monitoring Expressions . 55 Turning Off Display (Undisplay). 55 Assigning a Value to a Variable . 56 Evaluating Arrays . 56 Array Slicing for Arrays. ..

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    402 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us