1. Installation
sudo apt-get install Cflow
1. Role
Cflow [Options ...] [File] ...
Cases:
Cflow MAIN.C
Generating a function call relationship for an MAIN.C file example
Cflow-x MAIN.C
Generate a cross-reference table to view the location and file of the function call
Cflow-o Call_tree.txt MAIN.C
Generate a call relationship and output to a call_tree.txt file
cflow-d 5-o call_tree.txt main.c
Specifies the maximum call depth bit for the output 5
Other options: View with Cflow--help
Common options:
-D,--depth=number sets the drawing depth of the flowchart
-F,--format=name
Uses the specified output format name. Valid names are ' GNU ' (default) and ' POSIX '
-I,--include=classes contains the specified symbol class (see below). In CLASSES
Before placing ^ or-omitting them from the output
-O,--output=file sets the output file name (default =
-, standard output)
-R,--reverse * Print reverse Call Tree
-X,--xref only generate cross-reference lists
Symbol classes for--include parameters
_ The name of the symbol starting with the underscore
s static symbol
T typedefs (for cross-references only)
x all data symbols (external and static)
Syntactic analysis Control:
-A,--ansi * accepts only ANSI C standard source code
-D,--define=name[=defn] defines NAME as a macro
-I,--include-dir=dir will dir
Directories added to the list of directories to which beatles files can be searched
-M,--main=name assumes that the main function is a function called name
-P,--pushdown=number set initial identity stack size to number
--preprocess[=command],--cpp[=command]
* Executes the specified preprocessing command
-S,--symbol=symbol:[=]type Register symbol with given TYPE, or define an
Alias (if: = is used). Valid Types Are:keyword
(or kw), modifier, qualifier, identifier, type,
Wrapper. Any unambiguous abbreviation of the above
is also accepted
-S,--use-indentation * dependent indent style
-U,--undefine=name cancels all previous NAME pre-defined
Output control:
-B,--brief * Simple output
--emacs * for with GNU Emacs
Display additional format output in conjunction with
-L,--print-level * Print nested structure of call Tree
--level-indent=element Control Chart Display
-N,--number * Print line number
--omit-arguments * Do not print the parameter list in the function declaration section
--omit-symbol-names * Do not print symbol names in the declaration string
-T,--tree * draw a tree in ASCII form
Output Information options:
--debug[=number] Setting the debug level
-V,--verbose * Detailed error Diagnosis report
-?,--Help shows this list
--usage shows a concise usage message
-V,--version print program version
The required or optional parameters in the complete form of the option are also required or optional when using the abbreviated form of the option.
*
Each option marked with an asterisk is reversed, just like the long option name preceded by ' no-'. For example,--no-cpp
is to cancel the--cpp option.
Other tools:
Ctags
To create an index for all functions
Cxref:
To generate a cross-reference table
Generating code function call relationships with the Cflow tool