File: cflow.1

package info (click to toggle)
cflow 2.0-12.1
  • links: PTS
  • area: main
  • in suites: hamm, potato, slink
  • size: 128 kB
  • ctags: 163
  • sloc: ansic: 1,117; sh: 235; makefile: 102
file content (166 lines) | stat: -rw-r--r-- 3,561 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
.TH CFLOW 1
.SH NAME
cflow \- print a function call hierarchy
.SH SYNOPSIS
cflow [-Aagivx] [-d n] [-w n] [-r name] [cpp-opts] files
.SH DESCRIPTION
The
.B cflow
command reads
.I files
as program source and attempts to print a graph
of the program's function call hierarchy to the standard output.
Called functions are indented with respect to their calling functions,
and printed only once, in the order they occur.
.P
The first reference to function
.I func
is printed with the name of the file
and line number where it is defined, e.g.,
.sp
.RS
func {file.c n}.
.RE
.sp
Subsequent references are printed as:
.sp
.RS
func ... {mm},
.RE
.sp
where mm is the line number in  the graph of
.IR func 's
first reference.
Global variable references appear (if invoked with
the 
.I \-v
option) as:
.sp
.RS
var {v file.c n}.
.RE
.sp
External functions and variables are printed with a null source, i.e.,
.sp
.RS
func {}.
.RE
.sp
An ellipsis precedes the name of a function called recursively, e.g.,
.sp
.RS
 ... func ... {mm}
.RE
.SS OPTIONS
.TP 10
-a
Print a separate call graph for each function.
.TP 10
-A
Eliminate ansi keywords
.TP 10
-P
Eliminate POSIX keywords
.TP 10
.RI -d \ nn
Print the call graph to at most depth
.IR nn .
.TP 10
-g
Add to the list of C keywords GNU CC keywords.
.TP 10
-i
Print an inverted graph of depth 2, i.e.,  for each function (or
variable if used with the
.I \-v
option), print a list of functions which call it.
.TP 10
.RI -r \ name
Print a call graph with function or variable
.I name
as root (in the case of a variable, this only makes sense
if used with the
.I \-i
option).  This option may be repeated.
.TP 10
-v
Print references to global variables.  Only functions calls are printed
by default. 
.TP 10
-x
Print each sub-graph in full.  This overrides the default format
where subsequent references are abbreviated as described above.
.TP 10
\fR-D\fImacro \fRor -U\fImacro \fRor -I\fIdir\fR
Invoke cpp with the corresponding options.  If there is a makefile, then
the command
.I "make -n"
should indicate the proper flags to invoke
.I cflow
with.
.TP 10
-X
eliminate header files (empty files are made to a temporary location).
This often makes better results occur.
Files to look at eliminating are:
.in +5n
.nf
stdio.h
errno.h
ctypes.h
stdlib.h
.in
.fi
.TP 10
\-V
Echo commands as they are being executed.
.SH AUTHORS
The graph printing command
.I prcg
is essentially the one in
M. M. Taylor's
.IR calls (1)
as posted to the Usenet newsgroup comp.sources.unix.
A new parser,
.IR prcc ,
is based on Steven Kirkendall's
.IR ctags (1)
command which is distributed with the vi-clone
.IR elvis (1).
.br
Marty Leisner (leisner@sdsp.mc.xerox.com) got this working
on SunOS and Linux, and added a plethora of options to cflow;
rewriting cflow to use bash.
.SH ENVIRONMENT
Uses \fI$CPP\fP, which is normally $CC -E.
If $CC is not define, use gcc.
.br
.I PRCG
is defaulted to be the prcg program.
.br
.I PRCC
is defaulted to be the prcc program.
.SH HINTS
Sometimes redefine CPP as cat will produce output if you see
known.

.SH BUGS
An extern variable declaration is overridden by an actual (global) variable
declaration.  A complaint is written to stderr whether there is a conflict
or not.
.P
Function parameters are ignored.  If these parameters share the names
of global variables, then references to them are  flagged as external
references.
.P
The
.I static
qualifier is ignored.  Only the first definition of a function or
variable is recognized.
.P
It appears a definition like
.ft CW
.ti
main() { foo();
.ft
causes problems.