comp.lang.ada
 help / color / mirror / Atom feed
From: "Vincent Smeets" <No@SPAM.org>
Subject: Tool to calculate the stack size
Date: Wed, 7 Jul 2004 21:21:07 +0200
Date: 2004-07-07T21:21:07+02:00	[thread overview]
Message-ID: <cchifm$l1g$03$1@news.t-online.com> (raw)

Hallo,

Is there a tool to calculate the maximum stack size for an Ada program and
it's tasks?

I am developing a real time Ada program. One of the requirements on the code
is that for every task, the storage_size has to be defined. (for
T'Storage_Size use <some value>;) Because recursion isn't allowed, it is
given that the tasks will always have enough space.

The first phase of the development is done on a Sun Solaris with a GNAT 3.14
host compiler. After the program has been tested, it will be compiled by a
GNAT 3.14 cross compiler for VxWorks/PowerPC where it will be tested again.

Is there a tool to calculate the maximum stack size? I have looked at the
compiler and seen some options but no one gave the ideal output.
I can use the option "-save-temps" and search the assembler files for the
sparc-statement "save %sp,...,%sp" where the stack pointer is decremented to
allocate space for the local variables. After that, I have to find the call
tree and add all these values to get the maximum stack size.
I have seen that the MIPS-version has an option "-mstats". The documentation
says that it will output the needed stack space for every compiled function.
The problem is that I don't compile for MIPS and so I don't have this option
available.
I would like to have the call tree for every task and automatically
calculate
and summarize the stack size for every function called.


Vincent Smeets






             reply	other threads:[~2004-07-07 19:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-07 19:21 Vincent Smeets [this message]
2004-07-08 17:13 ` Tool to calculate the stack size Niklas Holsti
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox