Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ cflow(1) — AIX/RT 2.2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

as

cc

lex

lint

nm

pr

yacc

cflow

PURPOSE

     Generates a C flow graph of external references.

SYNOPSIS
     cflow [-r] [-ix] [-i_] [-dnum] files


DESCRIPTION

     The cflow  command analyzes C, yacc,  lex, assembler, and
     object files and writes a  chart of their external refer-
     ences to standard output.

     It sends files with suffixes .y,  .l, and .c to the yacc,
     lex,  and cpp  commands for  the appropriate  processing.
     This step  is bypassed  for .i files.   It then  runs the
     output of this processing through the first pass of lint.
     It assembles  files which end in  .s, extracting informa-
     tion from  the symbol table  (as it does with  .o files).
     From this output, cflow produces a graph of external ref-
     erences, which it writes to standard output.

     Each line of output begins with a line number followed by
     sufficient tabs  to indicate the level  of nesting.  Then
     comes  the name  of the  global, a  colon, and  its defi-
     nition.  This name is normally  a function not defined as
     external and  not beginning with an  underline character;
     see  the -i_  inclusion  flag on  p.  .  For  information
     extracted from C source files, the definition consists of
     an abstract type declaration  (for example, "char*"), the
     name of  the source  file, surrounded by  angle brackets,
     and the  line number on  which the definition  was found.
     Definitions extracted from object  files contain the file
     name  and   location  counter  under  which   the  symbol
     appeared.  cflow deletes  leading underline characters in
     C-style external names.

     Once cflow displays the definition  of a name, later ref-
     erences to  it contain only  the cflow line  number where
     the definition  may be found.  For  undefined references,
     cflow displays only <>.

     If  the nesting  level  becomes too  deep  to display  in
     available space,  pipe the  output from  cflow to  the pr
     command, using the -e flag  to compress the tab expansion
     to something less than every eight spaces.

     Note:  Files  produced by  lex and  yacc cause  the reor-
     dering  of line  number  declarations  which can  confuse

     cflow.  To get proper results, feed cflow the yacc or lex
     input.

FLAGS

     In addition  to the  following, cflow recognizes  the -I,
     -D, and -U flags of the cpp command.

     -dnum  Sets to decimal integer num the depth at which the
            flow graph is cut off.   By default this is a very
            large number.   Do not set  the cutoff depth  to a
            nonpositive integer.
     -ix    Includes  external and  static data  symbols.  The
            default includes only functions.
     -i_    Includes names that begin  with an underline char-
            acter.  The default  excludes these functions (and
            corresponding data if -ix is used).
     -r     Produces  an  inverted  listing  which  shows  the
            callers of  each function, sorted by  called func-
            tion.

RELATED INFORMATION

     The  following commands:   "as,"  "cc,"  "lex,"  "lint,"
     "nm," "pr," and  "yacc."

     The discussion of cflow  in AIX Operating System Program-
     ming Tools and Interfaces.

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026