stacktool.1 2.44 KB
.TH stacktool 1P local "Silicon Graphics, Inc."
.SH NAME 
stacktool \- static stack analysis tool for Ultra 64 development system
.SH SYNOPSIS 
\f3stacktool\f1 [-s segname] [-f resfile] [-r] filename
.SH DESCRIPTION
.I stacktool\^
is a utility which analyzes the stack usage of the target executable file,
specified by
.I filename\^
(i.e., the binary file).  It lists the stack usage
of each known function and its descendants in terms of bytes.  However,
all functions are not fully analyzable at this stage.  If there are
recursive calls inside a function or its descendants, a * mark is
attached at the end.  If there are unknown jal targets, a @ mark
is attached.  If there are unknown jalr targets, a # mark is attached.
If the target file is generated by
.I makerom,\^
and there is only one text segment,
the option \f3[-s segname]\f1 needs not be specified explicitly.
The \f3-r\f1 option tells the stacktool to list the
parent-child relationship in addition to the stack usage.  The \f3-f\f1
option is for the user to provide external information regarding
parent-child relationship.  For example, if the program uses pointers to
functions, the compiler will generate jalr when the pointer is dereferenced.
The syntax of the statements in the resolution file is:
<type> <parent> <children>, where <type> is either @ for unknown jal or # for
unknown jalr, <parent> is the name of the function in question, and <children>
is the name list of the unknown children of the function.  A sample resolution
file is provided in the distribution for resolving some jalr problems in the
OS.
.PP
Command line options are:
.RS 5
.TP 12
.B \-s segname
The text segment name is specified by
.I segname.\^
For executable generated by makerom, it should be something like .codesegment.
The default is the name of the first text segment that contains code.
.TP
.B \-f resfile
The resolution file name is specified by
.I resfile.\^
A sample resolution file for resovling unknown jalr in the OS is provided
in the distribution.
.TP
.B \-r
Show parent-child relationship by indentation.
.SH NOTE
This tool is only trying its best to analyze the static stack usage.  If
the target contains a lot of recursuve calls, uses pointers to functions,
or linked with shared option,
.I stacktool\^
may not be able to provide much help.  For thread stack size determination, one should
add 16 to the size reported by the corresponding function due to the calling
convention of the MIPS compiler.
.SH "SEE ALSO"
.IR makerom (1)