C++ Development Environment
The Current State of C++ Development
C++ is the language of choice for object-oriented developers. The promise of well defined interfaces, encapsulation of data and function, object reuse, class hierarchies, and modularity have lured developers interested in trying to deal with the increasing complexity of new software systems to adopt this new technology.
There are several problems facing developers using C++
Turnaround for changes to object interface definitions is slowed down by time consuming recompilations. Understanding and analyzing the object system from existing C++ code can be confusing. Developers providing shared libraries cannot make changes to object interfaces without invalidating applications that link with those libraries. Developers often have to start from scratch when building applications containing common objects and services (a major concern for C++ developers building GUIs based on X and MOTIF).
Click to view a jpeg image (1.2 MB).
The New Era of C++ Development
Silicon Graphics recognizes the importance of C++, and has developed a suite of new tools to solve these complex problems. The WorkShop Pro C++ Development Environment is comprised of the WorkShop core programming environment, the WorkShop Pro C++ development module, and the Delta/C++ compiler. Combined, these products provide programming solutions that help developers to be more productive, and ensure the quality of C++ - based software systems.
Tools to Support Rapid Turnaround
- Delta/C++ Compiler with Smart Build -A native C++ compiler with extensions to support precompiled header files and recompilation of source files only when necessary
Better Understanding of C++ Code
- C++ Class Browser - Comprehensive display and query of class definitions and the relationships between classes
- Debugger with Powerful Expression Evaluator- Support for C ++ expressions within the WorkShop debugger
- Performance and Coverage Analyzers with C++ knowledge - Support for C++ specific queries within the tools for identifying performance bottlenecks, memory errors, and test coverage
Compatibility of Changed Versions of C++ Shared Libraries
- Delta/ C++ Compiler - Support for shipping new versions of C++ shared libraries with compatible changes to class definitions
Motif GUI Application Development
- ViewKit - An application framework for building Motif GUIs
WorkShop Pro C++
Designed to Support C++ Developers, WorkShop Pro C++ is a software module layered on the core WorkShop toolset.
It provides more advanced tools specifically for the development of C++ applications, featuring:
- Smart Build extension to the Delta/C++ compiler
- C++ Class Browser
- ViewKit
The Pro C++ tools are designed to work with the Delta/C++ compiler.
Delta/C++ is a native C++ compiler, not a preprocessor. It is language compatible with AT&T/USL cfront 3.0 but provides advantages beyond cfront which include increased compile speed and better debugging support:
- The Delta feature of the compiler allows the user to make compatible changes to class definitions with minimal recompilation while placing few restrictions on the use of the language and without substantial runtime overhead.
- Current C++ systems such as cfront have been designed without considering the requirements of environments making use of shared libraries or dynamic loading. In these environments it must be possible to release new compatible versions of libraries or dynamically loaded components, without recompiling portions of the system that make use of the classes defined in these new components.
Existing C++ systems resolve all object references at compile time. Delta/C++ resolves all object references at link time, providing a clean way to separate class interface specifications from implementation. That is especially useful when developing evolving class hierarchies. This is the key technical difference. With Delta/C++, applications linked against a shared library will continue to run, without recompilation, even when a new "compatible" version of the shared library is released.
Compatible class changes include the following:
- Member Extension - Adding data and function members to a class
- Class Extension - Adding a new base class to an already existing class
- Member Promotion - Moving functionality from a derived class to a base class
- Override Changing - Changing the override behavior by adding or deleting a function or data definition in a derived class
- Member Reordering- Relocating function or data members within a class
Smart Build is an extension to the Delta/C++ compiler that dramatically reduces build times for C++ sources by supporting precompiled header files and leveraging the Delta feature of the compiler. Smart Build is a part of the WorkShop Pro C++ environment. Delta/ C++ cannot make use of this functionality outside of the Pro C++ environment.
Use of precompiled header files
- The compiler constructs a database per header file which is read on subsequent uses of that header file
- Faster processing of idempotent headers (i.e., surrounded by #ifndef _include_h)
- Especially helpful for large sets of includes such as X header files
Understands Delta compatible class changes
Header file is marked as unchanged if the changes are Delta compatible changes to a class definition
Understands other changes in header files
- Comments can be changed without recompilation
- New macro definitions can be made
Understands use of program elements in source file
- Does not recompile a source file if a change in a header file will not affect the compilation (For example, only the file containing the implementation of the changed class needs to recompile when the class declaration changes in a compatible fashion)
Compatible with any build environment
Because Smart Build is part of the compiler itself, it works seamlessly with any existing build environment by invoking the -smart flag
You can navigate through and analyze interdependencies among the class definitions and their implementations with the Class Browser.
Provides Multiple Views
The browser supports multiple views to provide the maximum amount of information in a concise, visual display. The views are organized with respect to the notion of classes in C++ and include:
- Class Information Window - Presents user configurable, comprehensive class member information and inter-class relationships
- Class Graph - Displays inter-class relationships graphically (inheritance, component, usage, friends)
- Static Analysis Window - Displays detailed results of queries
(QuickTime 4MB)
(AIFF 265KB)
- Call Graph Window - Displays method/function dependencies in a graph
Supports Extensive Class Queries
The browser provides a set of static analysis queries tailored for C++ programs. These queries help users analyze interdependencies of a class with its related classes such as base classes, derived classes, component/container classes, classes that are used, and friend classes. A few examples of queries on class members and related classes:
- Which members are declared or defined by a given base class
- Which methods are overridden by a given derived class
- Which classes use a given method
- Which members are used by a given class
- Which classes contain a given class
Scalable
The Class Browser handles extremely large programs, and provides easy navigation even when analyzing complex problems. Users can control the amount of information to be viewed when analyzing class relationship graphs or viewing class definitions. For example, the user can choose to display all class relationships or just immediate class relationships with respect to a class. Similarly, when viewing a class definition, users can choose to view just its public members.
Integration
The various views are integrated, providing the ability to select a class or method in one view and display additional information about it in another view. The Class Information Window can be invoked by clicking on a class in the Class Graph, and the Call Graph can be pruned or populated from the Class Information Window. Also, Source View, the annotated textual viewer used by all WorkShop tools, can be invoked by clicking on a class in any of the views.
ViewKit
ViewKit is an application framework for Motif development.
The ViewKit class library is a C++ application framework designed to simplify the task of developing applications based on the OSF/Motif user interface toolkit. The ViewKit promotes consistency by providing a common architecture for applications. It also improves programmer productivity by providing high-level, and in many cases automatic, support for commonly-needed operations.
In addition to providing facilities normally associated with a graphical user interface, the framework serves as a central integration platform for other facilities that applications typically need. These include support for:
- Inter-application communication
- The use of audio as an integral part of the application user interface
- Integration with the Silicon Graphics desktop
- Automatic on-line, context-sensitive help
Expression Evaluator
The Expression Evaluator handles native C++ syntax and provides support for various queries: Accessing of static and non-static data members and methods
- Can call virtual functions interactively
- Members inherited from base classes are clearly delineated
- Support for nested classes
- Support for virtual base classes
- Support of multiple inheritance
Trap Management
Can specify a particular overloaded function or operator and stop only in that function.
Delta/C++ Support
The debugger supports programs compiled with or without the "Delta" option in the new C++ compiler.
Performance Analyzer
The WorkShop Performance Analyzer allows the developer to accurately determine expensive functions and performance bottlenecks in a C++ program. The Performance Analyzer also supports the detection of memory errors. The Heap View in the Performance Analyzer provides a visual display of dynamic memory that highlights memory leaks and erroneous frees.
Additionally, the Performance Analyzer has support for determining the actual function used when a virtual function is called in the class hierarchy.
Tester
Tester is a dynamic test coverage tool that also has additional C++ support:
- Can determine which functions in the class hierarchy were actually invoked when making a virtual function call
- Can determine which overloaded functions were distinguished by function prototype