home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
182.lha
/
Calls
/
Calls.1u
< prev
next >
Wrap
Text File
|
1988-04-28
|
4KB
|
157 lines
.EV
.T1 CALLS 1EXP
.SH "calls \- print out calling pattern of a C program"
.SH SYNOPSIS
calls [-aeitv] [-w n] [-f function] [-F function[/file.c]] [-D name[=def]] [-U name] [-I dir] [filenames]
.SH DESCRIPTION
.I Calls
is intended to help analyze the flow of a program by laying out the
functions called in a hierarchical manner.
.I Calls
invokes the C preprocessor on the named C source files, and outputs
the analyzed calling pattern to standard output.
All filenames given will have their calling sequences combined into
one hierarchy.
If a filename of \- is seen, standard input will be read.
.P
Functions called but not defined within the source file are shown as:
.br
.RS
function
.RE
.P
While functions defined in the source files are listed with the file they
are declared in in brackets, as shown:
.br
.RS
function [main.c] , or
.br
function [static in main.c]
.RE
or if the function is not being described
.RS
function [see also %d] , or
.br
function [see below]
.RE
.P
Recursive references are shown as:
.br
.RS
function <<< recursive >>>
.RE
.P
For example, given the file
.B prog.c
.br
.RS
.nf
main() {
abc();
def();
}
abc() {
ghi();
jkl();
}
static mno() { }
ghi() {
abc();
def();
mno();
}
.fi
.RE
.sp
Executing "calls prog.c" will produce:
.sp
.RS
.nf
1 main [prog.c]
2 abc [prog.c]
3 ghi [prog.c]
4 abc <<< recursive >>>
5 def
6 mno [static in prog.c]
7 jkl
8 def
.fi
.RE
.SH FLAGS
.TP
.BI -a
Normally only the first call to a function is recorded for any
given function, under this option all calls are recorded. This may
make the output for some large programs very verbose and these are
normally not needed to show the calling structure of a program.
.TP
.BI -e
Normally an index listing (-i below) does not contain the external
functions called in the program, under this option these are also listed.
Note this option also turns on the indexing option, -i.
.TP
.BI -f function
The named function will be printed as the root of a calling tree.
.TP
.BI -F function\[/file\]
The named static function (in the given file) is used as the base of a
calling tree, as above. This allows closer examination of sources such
as that of dbx(1) that have many functions with the same name.
.TP
.BI -h
Display a brief help message.
.TP
.BI -i
This option produces an index of all the functions declared in the
processed files. Optionally all functions mentioned can be output;
see -e above.
.TP
.BI -t
This option instructs
.I calls
not to display calling trees that were
not explicitly asked for on the command line. Using this option as
well as the index option one can produce just a list of the functions
declared in a file.
.TP
.BI -v
Be less verbose in the index output, do not output any defined functions
that were not present in any of the output trees.
Note this also turns on the index option.
For a list of all functions called
by 'missle' one might examine the index output of "calls -vt -f missle *.c".
.TP
.BI -w n
Set the max indentation width to n. The default is 96 columns.
.TP
.BI -D name
.TP
.BI -D name=def
Define the
.I name
for the preprocessor, as if by #define.
If no definition is given, the name is defined as 1.
.TP
.BI -U name
Remove any initial definition of
.I name
in the preprocessor.
.TP
.BI -I dir
Change the path for searching for #include files whose names do not
begin with / to look in
.I dir
before looking in the directories on the standard list.
.br
.RE
.SH BUGS
Static functions must be declared (in full)
.I before
used to work properly.
.br
Output width checking is only done on the first character on a new line.
.SH AUTHOR
Originally from the net. Major revisions by Kevin Braunsdorf, PUCC.
.SH SEE ALSO
cpp(1), cc(1), ctags(1)