HP C and C++ SoftBench User Manual

C and C++ SoftBench User's Guide
Manufacturing Part Number: B6454-97413
June 2000
© Copyright 2000 Hewlett-Packard Company.
Legal Notices
The information contained in this document is subject to change without notice.
shall not be liable for errors contained herein or direct, indirect, special, incidental or consequential damages in connection with the furnishing, performance, or use of this material.
Copyright © 2000 Hewlett-Packard Company. This document contains information which is protected by copyright. All
rights are reserved. Reproduction, adaptation, or translation without prior written permission is prohibited, except as allowed under the copyright laws.
Corporate Offices:
Hewlett-Packard Co. 3000 Hanover St. Palo Alto, CA 94304
Use, duplication or disclosure by the U.S. Government Department of Defense is subject to restrictions as set forth in paragraph (b)(3)(ii) of the Rights in Technical Data and Software clause in FAR 52.227-7013.
Rights for non-DOD U.S. Government Departments and Agencies are as set forth in FAR 52.227-19(c)(1,2).
Use of this manual and flexible disc(s), compact disc(s), or tape cartridge(s) supplied for this pack is restricted to this product only. Additional copies of the programs may be made for security and back-up purposes only. Resale of the programs in their present form or with alterations, is expressly prohibited.
A copy of the specific warranty terms applicable to your Hewlett-Packard product and replacement parts can be obtained from your local Sales and Service Office.
Copyright © 1980, 1984, 1986 AT&T Technologies, Inc. UNIX and System V are registered trademarks of AT&T in the USA and other countries.
2
Copyright © 1994 X/Open Company Limited. UNIX is a registered trademark in the United States and other
countries, licensed exclusively through X/Open Company Limited. Copyright © 1980, 1984, 1986 Novell, Inc. Copyright © 1979, 1980, 1983, 1985-1990 Regents of the University of
California. This software is based in part on the Fourth Berkeley Software Distribution under license from the Regents of the University of California.
Copyright © 1990 Motorola, Inc. All Rights Reserved. PostScript is a trademark of Adobe Systems, Inc. Copyright © 1985-1986, 1988 Massachussetts Institute of Technology. X Window System is a trademark of the Massachussetts Institute of
Technology. Portions of this software and documentation are based in part on
software and documentation for the X Window System, Version 11, developed and distributed by Massachusetts Institute of Technology.
Copyright © 1989, 1990, 1993 Open Software Foundation. Portions of this software and documentation are based in part on Motif
software and documentation developed and distributed by the Open Software Foundation.
OSF/Motif is a trademark of the Open Software Foundation, Inc. in the U.S. and other countries.
RCS, the Revision Control System, manages multiple revisions of files. Copyright © 1982, 1988, 1989 Walter Tichy. Copyright 1990, 1991 by Paul Eggert. Distributed under license by the Free Software Foundation, Inc.
Copyright © 1986 Digital Equipment Corp.
3
Printing History
New editions of this manual incorporate all material updated since the previous edition.
The manual printing date and part number indicate its current edition. The printing date changes when a new edition is printed. Minor corrections and updates incorporated at reprint do not cause this date to change. The manual part number changes when extensive technical changes are incorporated.
August 1992 Edition 1 (B2600-90010) August 1994 Edition 1 (B2600-90031) January 1996 Edition 1 (B5072-90002) August 1996 Edition 1 (B5072-90017) February 1998 Edition 1 (B6454-90002) September 1999 Edition 1 (B6454-93003)
4
Table 1
Typeface Conventions
Convention Description
italic font
typewriter font Computer commands or other information that
boldface font A term that may need further clarification or
[…] Optional parameters in syntax examples are
KeyCap Represents a key on your keyboard that you
Information you supply, either in syntax examples or in text descriptions. Forexample,if told to type: name like sample. Italics are also used for emphasis, and for Titles of Books.
must be typed exactly as shown. For example, if told to type: sample, you type exactly the word in typewriter font, sample. Menu selections are in typewriter font separated by colons. See "Menu Conventions" in this chapter.
definition, especially a familiar word (such as menu) used with a computer-specific meaning. These terms are clarified in the glossary.
enclosed in brackets.
must press, or an on-screen button that you must select, as part of the operation. For example, Return is the "Carriage Return" key, which completes a command input. This key may be labelled "RETURN", "Return", or "Enter".
filename
, you supply an actual file
Key1-Key2 A hyphen between keys indicates that two or
more keys must be pressed at the same time. For example, "Control-C" means to press and hold the Control key while pressing and releasing the C key. The Control key may be labelled "CTRL", "Ctrl", or "Control".
5
6
1. Maximizing Your Results with SoftBench
SoftBench Task Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Understanding Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Building Targets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Understanding Build Configurations and Packages . . . . . . . . . . . . . . . . . . . . . . . . . 23
Choosing Between Project Build and External Build Models . . . . . . . . . . . . . . . . . . 25
Sharing Projects with a Team . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
One Project, One Author . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
One Project, Many Authors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
One Project with Subprojects, Many Authors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Planning Your Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Using the SoftBench Integrated Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Using SoftBench Tools Together . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Using SoftBench Tools on Multiple Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Using SoftBench Tools as Standalone Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Reusing Tool Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Copying Data between SoftBench Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
An Example SoftBench Session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Learning SoftBench . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Contents
2. Using SoftBench
Prerequisites to Using SoftBench . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Starting SoftBench . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Understanding SoftBench Window Areas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Understanding the Builder Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Understanding the SoftBench CodeAdvisor Page . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Setting Up a Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Creating a Project Using Project Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Creating a Project Using External Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Cloning a Project from an Existing Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Repartitioning an Existing Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Creating a Subproject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Modifying a Project Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Creating Files within a Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Adding Existing Files to a Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Defining Targets for Project Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Creating a Target . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Specifying Dependency Relationships . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
7
Contents
Customizing Build Configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Using Build Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Defining Targets for External Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Using the Target Graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Understanding the Graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Displaying Dependencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Controlling Graph Complexity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Building a Selected Target . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Starting Your Configured Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Building Projects and Targets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Setting the Compile Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Using the "External Build Command" Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Previewing the Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Compiling Instead of Building . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Building Subprojects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Handling Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Running the Build on a Remote System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Checking Your Code Using SoftBench CodeAdvisor . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Running Other SoftBench Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Managing Your SoftBench Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Adding and Removing Tool Icons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Choosing Tool Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Registering New Tools with SoftBench . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Customizing SoftBench by Setting Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Accessing Distributed Data and Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Running SoftBench on a Remote System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Integrating with CDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Stopping SoftBench . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Restoring Your Previous SoftBench Session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Getting Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .84
Using the Help Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Accessing On Item Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
If Something Goes Wrong . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
For More Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
3. Using SoftBench Configuration Manager
8
Contents
Understanding SoftBench CM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
Getting Started - A Brief Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Managing the Archive System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Browsing Local Network Servers and Archives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Creating an Archive Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Creating a Mapping between an Archive Directory and Local Directory . . . . . . . . . 98
Modifying Mappings between Local and Archive Directories . . . . . . . . . . . . . . . . . . 99
Managing Archive Files and Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Creating Initial Archive Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Checking Out Archive Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Cancelling Archive File Check Out . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Updating a Local Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Viewing Contents of Archive Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Deleting Archive Files and Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Locking an Archive File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Breaking a Lock on an Archive File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Viewing the Revision History of Archive Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Setting Archive Display Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Managing Local Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Modifying Local Source Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Checking In Modified Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Creating a Default Symbolic Name for Archive Files . . . . . . . . . . . . . . . . . . . . . . . . . 112
Understanding Symbolic Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Defining Symbolic Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
Symbolic Name Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
Using the SoftBench CM Command Line Interface . . . . . . . . . . . . . . . . . . . . . . . . . . 115
4. Using SoftBench Editors
Using Editors with Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
Configuring an Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Configuring SoftBench vi Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Configuring SoftBench Program Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Starting the Configured SoftBench Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Editing with SoftBench XEmacs Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
Using SoftBench XEmacs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
Accessing Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Editing Multiple Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Editing with SoftBench vi Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
9
Contents
Using the Mouse Pointer Versus the Text Cursor . . . . . . . . . . . . . . . . . . . . . . . . . . 127
Editing Multiple Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
Reusing the Edit Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
Selecting, Copying, and Pasting Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
Calling Other SoftBench Tools from the Editors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
Compiling a Program File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
Building a Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
Accessing SoftBench Static Analyzer from the Editor . . . . . . . . . . . . . . . . . . . . . . . 130
Setting Breakpoints in a Program File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Using Configuration Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
For More Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
5. Using SoftBench Class Graph/Editor
Editing C++ Structures with SoftBench Class Graph/Editor . . . . . . . . . . . . . . . . . . . 134
Understanding the SoftBench Class Graph/Editor Use Model . . . . . . . . . . . . . . . . 134
Using SoftBench Class Graph/Editor with Other SoftBench Editors . . . . . . . . . . . 136
Synchronizing Editor Views and the Static Database . . . . . . . . . . . . . . . . . . . . . . . 136
Using SoftBench Class Graph/Editor in Your Work . . . . . . . . . . . . . . . . . . . . . . . . . . 138
Viewing the Existing Class Hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
Creating New Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Modifying Existing Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Deleting Existing Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
Sample Use Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Creating a New Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Modifying an Existing Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Working with Class Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Using Configuration Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
If Something Goes Wrong . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
6. Using SoftBench CodeAdvisor
Comparing SoftBench CodeAdvisor to Debuggers or Dynamic Analyzers . . . . . . . . 148
Performing the "Check Code" Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
Preparing Your Program with Project Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
Preparing Your Program with External Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
Accessing SoftBench CodeAdvisor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
Selecting Rule Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
10
Checking Your Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
Viewing Violations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
Terminating SoftBench CodeAdvisor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
Filtering Rule Violations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
For More Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
7. Using SoftBench Debugger
Understanding SoftBench Debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
Preparing Your Program for Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Using SoftBench Debugger Window Areas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
Tearing Apart the Main Toolface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
Loading or Rerunning an Executable Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
Specifying the Runtime Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
Specifying Source Locations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
Debugging Executables in a Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
Stepping through Your Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
Interrupting a Running Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
Interrupting in System or Non-debuggable Routines . . . . . . . . . . . . . . . . . . . . . . . 172
Interacting with Your Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
Interacting with a Standard I/O Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
Interacting with a Terminal-Smart Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
Interacting with a Window-Smart Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
Specifying Identifier Locations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
Specifying Program Location . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
Specifying Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
Examining and Changing Data in Your Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
Examining Data in Your Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
Printing Hex or String Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
Changing Data in Your Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
Using Debugger Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
Using Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
Using Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
Calling Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
Viewing the Call Stack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
Viewing Thread Stacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
Understanding the Operation of Your Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
Setting and Using Breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
Debugging a Program Using Breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
Contents
11
Contents
Setting a Breakpoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
Viewing and Modifying Breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
Clearing a Breakpoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
Executing DDE Commands at a Breakpoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
Setting C++ Breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Setting Group Breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Viewing and Modifying Group Breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Setting and Using Watchpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
Creating Watchpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
Viewing and Modifying Watchpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
Clearing a Watchpoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
Tracing Program Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
Creating Traces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
Viewing Traces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
Clearing Traces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
Correcting Errors in Your Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
Editing Source Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
Synchronizing Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
Debugging Dynamic Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
Viewing Assembly Language and CPU Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
Tracing Assembly Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
Tracing Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
Handling Signals and Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
Viewing and Editing Intercepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
Handling Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
Debugging After a Program Fails (Core Dump) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
Debugging with a Core File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
Debugging Forked Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
Debugging Threaded Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
Viewing and Manipulating Threads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
Setting Breakpoints on Threads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
Attaching the Debugger to a Running Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
Debugging C++ Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
Using Breakpoints for Exception Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
Accessing Inherited C++ Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
Debugging Static Constructors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
12
Debugging Optimized Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
Customizing SoftBench Debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
Specifying Debugger Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
Customizing User Buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
If Something Goes Wrong . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
For More Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
8. Using SoftBench Debugger Data Graph Window
Starting and Stopping the Data Graph Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
Beginning a Browsing Session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
Stopping a Browsing Session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
Understanding Data Graph Window Areas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
Understanding the Layout Control Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
Understanding the Display Control Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
Understanding the Graph Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
Understanding the Window Control Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
Using the Graph Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
Displaying New Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
Using the "Node Values" Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
Suspending Graph Updates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
Deactivating the Graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
Stopping a Graph Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
Sample Use Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
Verifying Correct Data Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
Viewing Values of Data Members . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
For More Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
Contents
9. Using SoftBench Static Analyzer
Starting SoftBench Static Analyzer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
Preparing to Make Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
Generating Static Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
Updating Static Data without Building . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
Specifying Static Data to Analyze . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
Using SoftBench Static Analyzer Window Areas . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
Making Textual Static Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
Making General Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
Making Queries Based on a Program Identifier . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
Using Query Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
13
Contents
Browsing the Query Result . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
Editing the Source File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
Updating the Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
Performing a Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
Simplifying Query Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
Filtering Results Using the File Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
Filtering C++ Query Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
Using Scoping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
Redisplaying Past Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
Redisplaying Query Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
Deleting a Query Result . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
Saving and Printing a Query Result . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
Using SoftBench Static Analyzer in Standalone Mode . . . . . . . . . . . . . . . . . . . . . . . . 273
Generating Static Data from the Command Line . . . . . . . . . . . . . . . . . . . . . . . . . . 273
Searching Subdirectories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
Using the Staticfileset File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
Customizing SoftBench Static Analyzer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
If Something Goes Wrong . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
For More Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
10. Using Static Graphs
Starting SoftBench Static Analyzer Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
Making Graphical Static Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
General Static Graph Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
Finding Graph Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
Operating on Static Graph Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
Switching between Static Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
Displaying Nodes on Another Graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
Using Description Boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
Setting Breakpoints for SoftBench Debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
Saving Static Graph Images to Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
Simplifying Graph Displays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
Reducing Graph Complexity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
Filtering Sourceless Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
Customizing Static Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
Removing the Graph Legend . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
14
Viewing Multiple Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
11. Using SoftBench File Compare
Understanding the SoftBench File Compare Window . . . . . . . . . . . . . . . . . . . . . . . . 296
Understanding the Menu Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
Understanding the "Working Directory" Input Box . . . . . . . . . . . . . . . . . . . . . . . . . 296
Using the "Left File" and "Right File" Input Boxes . . . . . . . . . . . . . . . . . . . . . . . . . 297
Using the "Merge File" Input Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
Understanding the Text Areas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
Reading the Gutter Column . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
Selecting Lines for Merging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
Highlighting Differences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
Traversing by Single Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
Comparing Two Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
Merging Compared Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
If Something Goes Wrong . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
For More Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
12. Using SoftBench Message Monitor
Starting SoftBench Message Monitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
Understanding the SoftBench Message Monitor Window Area . . . . . . . . . . . . . . . . . 307
Understanding the Menu Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
Understanding Broadcast Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
Clearing the Broadcast Message Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
Composing and Sending a Message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
Logging Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
Specifying a Log File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
Starting and Stopping Message Logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
Contents
13. Using SoftBench with SQL
Determining Supported Environments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
Configuring SoftBench with SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
Using Default SQL File Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
Using SQL with Project Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
Using SQL with External Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
Updating RDBMS Versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
Using SQL with SoftBench Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
Using SQL Preprocessor Wrappers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
15
Contents
Debugging with SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
Editing and Rebuilding with SQL for SoftBench Debugger . . . . . . . . . . . . . . . . . . 321
Using SoftBench CodeAdvisor and SoftBench Static Analyzer with SQL . . . . . . . 321
For More Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
A. Using SoftBench Graph Windows
Accessing SoftBench Graph Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324
Using Graph Window Areas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
Using Popup Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
Using Save Options for the Graph Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
Using Vertical and Horizontal Scrolling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330
Zooming In or Zooming Out . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
Clearing the Graph Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
Understanding Nodes and Arcs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332
Reading Graph Area Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332
Selecting Nodes and Arcs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332
Moving Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
Customizing SoftBench Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336
Controlling Graph Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336
Controlling Graph Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336
Understanding Window Status Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
For More Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338
B. Customizing SoftBench CM Configuration
Modifying the Configuration Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
Configuring Where Archive Files are Stored . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341
Defining User Access to the Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
Recommended Format for Permissions File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
Setting Logging and Debug Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346
Controlling Client Machine Access to the SoftBench CM Server on HP-UX . . . . . 346
Performing SoftBench CM Administrator Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348
Migrating Archive Files From RCS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348
Migrating Archive Files From SCCS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348
Modifying the Lockinfo File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
Creating Archive Backups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
Moving Archive Storage Locations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
16
Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
C. Using Regular Expressions
Pattern Matching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
D. Customizing SoftBench for Native Language Support (NLS)
Preparing to Use NLS in SoftBench . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362
Setting the LANG Environment Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
Converting from One Encoding Method to Another . . . . . . . . . . . . . . . . . . . . . . . . 365
Rebinding Alt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
SoftBench Mnemonics and Non-USASCII Character Inputs . . . . . . . . . . . . . . . . . . . 367
Changing or Removing Menu Mnemonics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
SoftBench Keyboard Accelerators and Non-USASCII Character Inputs . . . . . . . . . 369
Customizing Keyboard Accelerators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
Starting Your Localized SoftBench . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
Remote Execution Hosts and NLS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
Editing in SoftBench . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
Character Input Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
Contents
Glossary
17
Contents
18
Maximizing Your Results with SoftBench
1 Maximizing Your Results with
SoftBench
SoftBench facilitates the development of reliable software, an especially difficult and time-consuming process when you work on large and complicated projects. SoftBench provides an integrated, consistent windowed interface to the tools you need the most.
Chapter 1 19
Maximizing Your Results with SoftBench
SoftBench Task Flow
SoftBench Task Flow
The tools pass information and control from one tool to the next, helping you move smoothly through the software development and maintenance tasks shown in Figure 1-1.
Figure 1-1 Major Software Development Tasks Supported by SoftBench
SoftBench tools and the data on which they operate can be distributed across a network and accessed transparently by individuals or teams. SoftBench provides an open, customizable environment, allowing users to add their own tools or purchase products integrated by third party software vendors. Additionally, SoftBench provides online help and an online tutorial to simplify learning.
SoftBench provides a dynamic build environment. As you develop your project, SoftBench learns about your source files and how to transform them into your build targets. Based on build information contained in build configurations, SoftBench can maintain the Makefile instructions for you. SoftBench automatically shares this knowledge about files and targets in your project with other SoftBench tools.
SoftBench project management allows you:
• ease of navigation through project code and files that may be spread across file system directories
• automatic maintenance of simple to complex target dependencies
• definition of the project once, so that all tools benefit from the knowledge rather than maintaining multiple lists of files throughout your toolset
Chapter 120
Maximizing Your Results with SoftBench
Understanding Projects
Understanding Projects
Projects are the fundamental work unit in SoftBench. Projects consist
of a named set of files that produce a set of related targets using one or more sets of build instructions and dependencies.
Figure 1-2 SoftBench Tools Interacting with Project and Files
The critical parts of a project definition are:
Project Name The logical name for the project. Local Workspace Root The root directory of the file system hierarchy
under which all your source files are found, and where editing and building take place. The project does not have to include all the files under the hierarchy, and files in the hierarchy can be used in different projects if desired.
Chapter 1 21
Maximizing Your Results with SoftBench
Understanding Projects
Project file set The source, documentation and test files you wish to
associate with the project.
Project targets The executables, libraries, message catalogs, and other
files that are the product of one or more builds.
Build Configurations Instructions for how to transform your source files
into your target files.
Project names contain regular characters. Control characters, spaces, and punctuation characters special to the shell are not allowed in project names.Thefiles and targets that comprise your project are located under your local workspace root. SoftBench's project description data contains lists of these files and their relationships.
When you change file and target information in SoftBench, you change only SoftBench internal descriptions of their relationships. For example, deleting a file from a project only changes your project description data. It has no impact on your files in the file system.
Subprojects are projects with a defined dependent relationship to a parent project. A subproject relationship implies a build order dependency. A project is always an entity to itself; that is, it does not dynamically inherit options or build information from any other project. Examples of subprojects include:
• a project to build a library that is linked into a parent project target
• a project to build an executable that is used to generate files or targets in the parent project
Building Targets
Source files are files you create and edit directly. A target is a project file that is the end product of a build. Examples of targets include linked executables, shared libraries, archive libraries, and message catalogs.
Chapter 122
Maximizing Your Results with SoftBench
Understanding Projects
Figure 1-3 Building Sources into Targets Using Project's Build Instructions
Targets that SoftBench builds:
• are project-specific. They are not shared between projects, though projects may have targets of the same name
• are user defined
• are created from a build within a project
• are built in no specified order unless a specific dependency has been created between them
• each have a physical file system location specified when you define the target
• are distinguished from intermediate files (.o's or .C's built from lex or SQL files)
Not every target is an executable file and not every executable file in a project is a target. Targets are created from a build within the project and are only those things a user has defined as such.
Understanding Build Configurations and Packages
A build configuration provides the complete set of build instructions to produce a target of a particular type, such as a C++ executable, a C shared library, or an Oracle C executable. Build configurations specify libraries, include directories, compiler options, defines, and other information required to transform source files into a target. When you use project build, you can use one of the many default build
Chapter 1 23
Maximizing Your Results with SoftBench
Understanding Projects
configurations provided by SoftBench. Build configurations are independent of projects and targets. SoftBench
ships with a basic set of build configurations. You can create new user build configurations based on the shipped build configurations, adding build instructions that are unique to your environment. To have your administrator save these as shared customizations available to other users, see "Sharing Build Configurations with Your Team" in SoftBench Online Help.
Once you decide on build configurations (system or customized) that work for your environment, you can use the same build configuration for many targets, and you can further customize a build configuration for a specific target.
A build package is a collection of build instructions that makes it easy to use third-party libraries, utilities, or compiler directives in many build configurations. Packages also make it easy to specify the compiler to use for the target. Packages are similar to build configurations because they include library and include directories, compiler options, defines, and other information needed for using the library or utility. First, choose a system or customized package; then include the package in all appropriate build configurations. If the package's build instructions need to change, you modify the package, and all build configurations which use the package update automatically.
For example, SoftBench provides packages for Motif, X11R6, SoftBench Encapsulator, RogueWave, and Oracle. If the requirements for building the library change, you can modify customized packages. All build configurations that include the package automatically update to use the modified package.
A transform is a set of operations that run a program or shell utility that converts a file from one form to another. Forexample, the C compiler transforms a source file into an object file. SQL preprocessors transform a source file with embedded SQL into a generated source file with all the SQL statements expanded. The gencat utility transforms a file of message strings into a message catalog. For more information about these concepts, refer to the "SoftBench Key Concepts" topics on "Build Configurations", "Build Packages", and "Transforms" available through "Help: Overview".
Transforms are the building blocks of build packages and build configurations. A build package contains zero or more transforms plus modifiers that influence how transforms operate. An example of a
Chapter 124
Maximizing Your Results with SoftBench
Understanding Projects
package with no transform, just modifiers, would be the X11 library to be linked into an executable. A build configuration contains one or more transforms and zero or more packages (which may include transforms and/or other packages). A very simplified version of the actual build configuration to create an executable target from C source containing embedded SQL is shown in Figure 1-4.
Figure 1-4 Simplified Build Configuration, Package, and Transform Series
Choosing Between Project Build and External Build Models
SoftBench supports two build models, allowing you two ways to specify your build instructions:
• With project build, you supply the necessary information to SoftBench, and SoftBench converts the build configuration and dependency information into build commands.
Chapter 1 25
Maximizing Your Results with SoftBench
Understanding Projects
Project build lets SoftBench manage your build instructions. You can specify source-to-target dependencies and build order dependencies, choose convenient system or customized build configurations and build packages, and automatically generate Makefiles or do without Makefiles altogether if you prefer.
• SoftBench provides an external build model as an alternative to project build for people who already have a highly-tuned build environment. With external build, you edit and maintain the Makefile or build script. SoftBench provides an "External Build Command" dialog box for you to initiate your builds.
External build lets you use your own make utilities, such as imake, make,ornmake files or scripts. External build is the opposite of project build, where SoftBench handles building without the need for a Makefile. SoftBench does not read or parse your Makefile. By using external build you lose some of the conveniences that project build provides, such as access to the target graph and automatic generation of a Makefile. You can also add secondary source locations to SoftBench's search lists through alternate source roots.
The "External Build Command" dialog box can be utilized during project build to build software which is not in a project, or to execute a shell command and view the output in the output browser.
Recommendation: Use project build for your projects whenever possible. You may choose to use external build and maintain the make process yourself when:
• You have one source that becomes many types of objects.
• Your process cannot use file suffixes to tell what file types are in use.
• Your build process uses the VPATH environment variable for make(1).
• You have a working build process and are perfectly happy with it.
Chapter 126
Maximizing Your Results with SoftBench
Sharing Projects with a Team
Sharing Projects with a Team
SoftBench projects provide the flexibility to have your development environment reflect your team interactions.
Sharing a project description has all the benefits and difficulties associated with sharing any source file. A centralized project description means that everyone is working from the same project files, but there can be collisions when more than one person wants to make changes. You may "break up" your file into several subprojects so that people can work independently and let SoftBench handle the complexities and relationships of the build.
There are several scenarios for partitioning a project:
• One Project, One Author
• One Project, Many Authors
• One Project with Subprojects, Many Authors
One Project, One Author
When your project has only one author, you may want to set up a single project definition.
Alternatively, you can choose to use subprojects to organize your work hierarchically, if that is more convenient. For example, if the subproject is a library, you can modify the build configuration of targets in the parent project to use the library. If you work on both the library and its parent project, using the subproject relationship provides the flexibility to either build the subproject or use it in its current state. If you never want to build the subproject alone, setting up the subproject relationship may not be the best way to structure the project. You can just leave all your targets in one project and use build-order dependencies.
One Project, Many Authors
As your project grows past what one author can accomplish, you face the issues of sharing the work across the team.
The preferred way to work at this level is to designate one person as the owner of the project definition file and have the rest of the team clone
Chapter 1 27
Maximizing Your Results with SoftBench
Sharing Projects with a Team
from that definition for their local working copies. Anyone who discovers the need for a change in the project definition communicates that to the owner, who makes the update, and then all of the team members re-clone their project definitions.
Figure 1-5 Team Members Cloning the Project Definition
The least usable method is to share the project definition files. Choose "Options: Set Default Project Root…" to specify the location of the shared project definition. Sharing a project definition has several limitations, primarily that only one person can open the project at a time.
Chapter 128
Maximizing Your Results with SoftBench
Sharing Projects with a Team
Figure 1-6 Team Members Sharing the Project Definition
One Project with Subprojects, Many Authors
Finally, your team can choose to divide up the project along the same lines as they divide up the work, especially if the project is large enough that multiple teams are cooperating on a single system release.
Figure 1-7 Team Members Using Subprojects
Each person's module of work may be designated as a subproject of the team's project. Team members then open the parent project for short periods of time, as necessary, but work primarily in the subprojects.Each team member's project is a subproject of the larger project, then the whole team's project is actually a subproject of the overall system delivery. Using SoftBench to manage this level of hierarchical complexity saves tremendous time and confusion when system builds are needed.
Chapter 1 29
Maximizing Your Results with SoftBench
Sharing Projects with a Team
Chapter 130
Loading...
+ 375 hidden pages