Release 1.9, patchlevel 0
Official release date: 11/21/2003.
Summary
This release of CodeSurfer introduces several new features and some
major improvements to the system. A new feature allows a user to
compute a number of standard metrics for their project. The graphical
user interface has changed considerably. The build process offers some
major improvements in performance and scalability. Additionally, the
user can choose from a wider range of build options.
This release offers some support for C++ programs. It can be
thought of as an alpha release of CodeSurfer for C++. Although it can
be used to build many C++ programs, it is incomplete in the following
ways:
- There are no library models for C++.
- Support for exception handlers is weak.
- The GUI does not present all of the available information in
the best way.
- Inlined functions can trigger performance and scalability
problems.
- It has not been fully tested on real-world C++ programs.
Major Features in CodeSurfer 1.9
- Metrics
CodeSurfer now allows users to compute a set of standard code
metrics including the popular Halstead metrics, as well as
cyclomatic complexity and a variety of line count metrics.
- Library
models
CodeSurfer now builds all projects with library models by
default. The standard installation ships with a set of pre-built
library models. The library models themselves have been improved
and are more complete than previously. A new option allows the user
to suppress the display of vertices in library models.
- GUI
- Project
Viewer. The project viewer now boasts a class view of the
project as well as the original file view.
- File
Viewer. The file viewer now offers a single tabbed window
with which to view all files. An optional column allows the
display of line numbers.
- Property
Sheets. Most property sheets now show a tabbed view of
the information associated with the selected item. A new
tabular view of some of the properties allows information to
be presented more compactly.
- Preferences.
The interface for setting user preferences and project
settings is very much improved.
- Popup
menus. The performance of popup menus for large
selections has been improved enormously.
- Finder.
The finder now offers a Find
Type feature for locating the definitions or uses of a
type.
- Filtering.
The filtering mechanism has been extended so that items
originating in system include files and library models can be
hidden.
- Pointer Analysis
- Inlining.
A new set of options for adding a degree of
context-sensitivity to the pointer analysis algorithm have
been added. These work by treating some function calls as if
they were inlined. Functions that have been identified as
allocators are given special treatment, as these are
especially important for the pointer analysis.
- Hints.
A new set of options for controlling the pointer analysis
have been added. These allow the user to override the default
conservative assumptions of the pointer analysis
algorithms. Using these options may mean that the points-to
graph may be incomplete.
- Build
option presets
A new way of specifying sets of build options have been added. The
user can choose lite, medium, high or
highest. The lowest setting specifies little analysis,
omitting pointer analysis and dependence analysis, and is useful
for computing metrics, or for basic code browsing. This setting
should scale easily to very large programs. The highest level
specifies the most advanced analysis available. Due to the large
quantity of computing resources required, it may fail to complete
for large programs.
- Support for MS DDKs
Support for projects hosted under the Microsoft DDKs has been
added.
- Better
support for MS Visual Studio projects
The support for projects hosted under Microsoft Visual Studio
(MSVS) has been improved substantially. CodeSurfer now supports
all versions of MSVS. A new feature allows a user to import an MSVS
.dsp file into CodeSurfer. The CodeSurfer Controller,
which runs alongside MSVS and provides an integration with the MSVS
build system, has been improved.
- New
customizable compiler model
CodeSurfer now offers a generic compiler model, named xcc,
which can be customized to allow CodeSurfer to model C compilers
other than those directly modeled by CodeSurfer.
- Diagnostics
New diagnostic facilities have been added to improve our ability to
diagnose problems with CodeSufer in the field.
- Heap allocating functions
CodeSurfer no longer replaces calls to allocator functions (such as
malloc, calloc, etc.) with calls to synthetic
heap-allocating functions. These functions, and the associated
#heap variables are no longer created. Instead, the calls
are treated as direct calls to the library model for the allocator,
and the pointer analysis inlining
takes care of assigning special names to the newly allocated memory
regions. The user can now specify which functions are to be allocators
and deallocators.
- Unused inlined functions
Functions that are specified as extern inline, but which
are never called are now ignored and treated as dead code. This
removes a large number of duplicate functions from projects.
- Immutable
preprocessor definitions
CodeSurfer now allows users to specify C preprocessor macros that
cannot be changed or undefined. This is useful for overriding
definitions in standard header files that cause build
problems.
- GMOD/GREF
It is now possible to view and manipulate the set of non-local
variables used and defined by a procedure.
- Inlining of glibc functions
By default, the gcc
compiler model now defines the __NO_INLINE__ preprocessor
symbol. This prevents commonly-used functions such as
strcpy from being inlined by the preprocessor. Previously,
these were inlined to assembly language instructions, which
resulted in CodeSurfer missing dependences because such
instructions are not analyzed.
API/Representation Changes
There have been a large number of changes to the CodeSurfer API and
to the dependence-graph representation. The most significant of these
are described below. If you have written scripts for previous versions
of CodeSurfer, and they no longer work with this version, then please
feel free to contact us for assistance on adapting them.
- SSA
form
CodeSurfer can now optionally compute the static single assignment
(SSA) form of the control-flow graph.
- Serialization
A set of new functions have been added that allow serialization of
PDG vertices to a persistent store. See serialize-data
and deserialize-data.
- Varargs
The representation of the arguments of calls to variable arity
functions has changed. Previously there was only one actual-in
vertex representing all the arguments that corresponded to the
single "..." formal-in vertex. Now there are as many
actual-in vertices as there are actual parameters.
- Normalization
Many of the normalizations have been changed so as to decrease the
number of temporary locations used. See the description of
normalization for short-circuiting
boolean expressions and conditional
expressions.
- $return variables
The organization of vertices at call sites has changed. Previously
a statement such as x=foo() was treated as follows:
call foo();
tmp = foo$return;
x = tmp;
where foo$return was an abstract variable representing the
value returned from the function. Now, there is a variable
foo$result for each call site. The above call is now
treated as:
call foo();
x = foo$result;,
where foo$result is a variable killed in the actual out
vertex associated with the call site. Note that there is one
$result variable for each call site, whereas previously there was
one $return for each PDG that returned a value.
- ABS_LOC
API changes
- ARRAY
A new type for representing arrays of Scheme objects has been
added.
- AST
API changes
- The class formerly known as <edgcp-expr>
has been renamed c:ast. The class formerly known as
<edgcp-ast-proper> has been renamed to
cc:ast.
- A new function ast-for-uid
returns the AST for a given compilation..
- Bitwise
operations API
A handful of new bitwise operations for doing masking, shifting and
rotation have been added.
- INT_PAIR_SET
API
equal?
and eqv?
now work correctly for INT_PAIR_SET objects.
- Miscellaneous
API
A new set of functions for manipulating files and for retrieving
the system time have been added.
- PDG
API
Several new functions have been added for retrieving information
about PDGs. Some functions have changed slightly
- SDG
API
The following functions are new, or have had their semantics
changed:
- (sdg-sccs)
returns a list of the strongly-connected components of the
call graph.
- (sdg-retrieve-pdg
pid) returns the PDG with the given unique id.
- The function s-build-sdg-from-cfgs
has a different signature.
- The semantics of the functions s-predecessors,
s-successors,
f-pred
and f-succ
have all changed. They all take an extra optional integer
parameter named threshold. The computation of the
set is prematurely terminated if the size of the accumulated
set reaches threshold. The return value can be used
to extract the partial result.
- SET_NATURAL
API
A new type for efficiently representing sets of natural numbers has
been added.
Fixes
There have been too many bug fixes and other miscellaneous
improvements to enumerate.