N64® Functions Menu

al - Audio Library Functions
gDP - DP GBI Macros
gdSP - General GBI Macros
gSP - SP GBI Macros
gt - Turbo Microcode RDP
gu - Graphics Utilities
Math - Math Functions
nuSys - NuSystem
os - N64 Operating System
sp - Sprite Library Functions
uh - Host to Target IO
64DD - N64 Disk Drive

Nintendo® Confidential

   

stacktool

Format
stacktool [-s segname] [-f resfile] [-r] filename

What This Tool Does
It is a static stack analysis tool for the N64 development system. Specifically, it is a utility that analyzes the stack usage of the target executable file, specified by filename (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, an asterisk (*) is attached at the end. If there are unknown jal targets, an at sign (@) is attached. If there are unknown jalr targets, a pound sign (#) is attached. If the target file is generated by the makerom tool, and there is only one text segment, the option [-s segname] need not be specified explicitly. The -r option tells stacktool to list the parent-child relationship in addition to the stack usage. The -f option is for the user to provide external information regarding the 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 an at sign (@) for an unknown jal or a pound sign (#) for an 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.

Command Line Options
  • -s segname The text segment name is specified by segname. For executables generated by the makerom tool, it should be something like .codesegment. The default is the name of the first text segment that contains code.
  • -f resfile The resolution file name is specified by resfile. A sample resolution file for resolving unknown jalr in the OS is provided in the distribution.
  • -r Show parent-child relationship by indentation.
Note
This tool is only trying its best to analyze the static stack usage. If the target contains a lot of recursive calls, uses pointers to functions, or is linked with shared option, stacktool may not be able to provide much help. For thread stack size determination, you need to add 16 to the size reported by the corresponding function due to the calling convention of the MIPS compiler.

See Also
makerom (Irix 5.3)
makerom (Irix 6.x)



Nintendo® Confidential

Warning: all information in this document is confidential and covered by a non-disclosure agreement. You are responsible for keeping this information confidential and protected. Nintendo will vigorously enforce this responsibility.

Copyright © 1998
Nintendo of America Inc. All rights reserved
Nintendo and N64 are registered trademarks of Nintendo
Last updated January 1998