prcc1
Print a function call hierarchy
Part of cflow(1).
Usage
cflow [-Aagivx]
[-d
n]
[-w
n]
[-r
name]
[cpp-opts]
files
Overview
The cflow command reads 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.
The first reference to function func is printed with the name of the file and line number where it is defined, e.g.,
func {file.c n}.
Subsequent references are printed as:
func ... {mm},
where mm is the line number in the graph of func's first reference. Global variable references appear (if invoked with the -v option) as:
var {v file.c n}.
External functions and variables are printed with a null source, i.e.,
func {}.
An ellipsis precedes the name of a function called recursively, e.g.,
... func ... {mm}
Options
-
-a -
Print a separate call graph for each function.
-
-A -
Eliminate ansi keywords
-
-P -
Eliminate POSIX keywords
-
-d nn -
Print the call graph to at most depth nn.
-
-g -
Add to the list of C keywords GNU CC keywords.
-
-i -
Print an inverted graph of depth 2, i.e., for each function (or variable if used with the -v option), print a list of functions which call it.
-
-r name -
Print a call graph with function or variable name as root (in the case of a variable, this only makes sense if used with the -i option). This option may be repeated.
-
-v -
Print references to global variables. Only functions calls are printed by default.
-
-x -
Print each sub-graph in full. This overrides the default format where subsequent references are abbreviated as described above.
-
-Dmacro or -Umacro or -Idir -
Invoke cpp with the corresponding options. If there is a makefile, then the command make -n should indicate the proper flags to invoke cflow with.
-
-X -
eliminate header files (empty files are made to a temporary location). This often makes better results occur. Files to look at eliminating are:
stdio.h errno.h ctypes.h stdlib.h
-
-V -
Echo commands as they are being executed.
Environment
Uses $CPP, which is normally $CC -E. If $CC is not define, use gcc.
PRCG is defaulted to be the prcg program.
PRCC is defaulted to be the prcc program.
Hints
Sometimes redefine CPP as cat will produce output if you see known.