cflow(1) DG/UX 4.30 cflow(1)
NAME
cflow - generate C flow graph
SYNOPSIS
cflow [-r] [-ix] [-i ] [-Dname=value ] [-Uname ] [-dnum]
files
DESCRIPTION
Cflow analyzes a collection of C, YACC, LEX, assembler, and
object files and tries to build a graph charting the
external references. Filenames with a suffix of .y, .l, .c,
and .i are processed by yacc(1), then lex(1), then the C
preprocesser (bypassed for .i files), and then run through
the first pass of lint(1). Filenames with a suffix of .s
are assembled and information is extracted (as in .o files)
from the symbol table.
Each line of output begins with a line number, followed by a
suitable number of tabs indicating the level. Then the name
of the global function follows. This is normally only a
function not defined as an external or beginning with an
underscore; see below for the -i inclusion option. Then a
colon and its definition follow. For information extracted
from C source, the definition consists of an abstract type
declaration (e.g., char *), and, delimited by angle
brackets, the name of the source file and the line number
where the definition was found. Definitions extracted from
object files indicate the file name and location counter
under which the symbol appeared (e.g., text). Leading
underscores in C-style external names are deleted.
Once a definition of a name has been printed, subsequent
references to that name contain only the definition's line
number. For undefined references, only <> is printed.
As an example, given the following in file.c:
int i;
main()
{
f();
g();
f();
}
f()
{
i = h();
}
the command
Licensed material--property of copyright holder(s) Page 1
cflow(1) DG/UX 4.30 cflow(1)
cflow -ix file.c
produces the output
1 main: int(), <file.c 4>
2 f: int(), <file.c 11>
3 h: <>
4 i: int, <file.c 1>
5 g: <>
When the nesting level becomes too deep, use the -e option
of pr(1) to compress the tab expansion to something less
than every eight spaces.
Cflow has these options:
-r Reverse the "caller:callee" relationship, producing
an inverted listing showing the callers of each
function. The listing is also sorted in
lexicographical order by callee.
-ix Include external and static data symbols. The default
is to include only functions in the flowgraph.
-i Include names that begin with an underscore. The
default is to exclude these functions (and data if
-ix is used).
-dnum The num is a positive decimal integer that indicates
the depth at which the flowgraph is cut off. By
default this is a very large number.
-Dname=value
Define name to be value.
-Uname Undefine the initial use of name (either defined with
-D or defined by the compiler, i.e., DG/UX).
DIAGNOSTICS
Complains about bad options. Complains about multiple
definitions and only believes the first. Other messages may
come from the various programs used (e.g., the C-
preprocessor).
SEE ALSO
as(1), cc(1), cpp(1), lex(1), lint(1), pr(1), yacc(1).
BUGS
Files produced by lex(1) and yacc(1) reorder line number
declarations, which can confuse cflow. To get proper
results, feed cflow the yacc or lex input.
Licensed material--property of copyright holder(s) Page 2