Adam Dunkels wrote:
Chris Liechti wrote:
however i'm not using them because the bytes used for multiple stacks without overflows are too precious and getting each stack depth as minimal as possible isn't always easy (and still wasting bytes). i often use the eventhandler that can be found in the mspgcc library (see examples/libraries/eventhandler)

There is an AVR tool called stacktool by John Regher that computes the maximum stack depth by analyzing the binary code: http://www.cs.utah.edu/~regehr/stacktool/

I haven't used it myself, but it is a very cool approach. (It isn't ported to the MSP430.)
Static stack analysis tools used to be a fairly standard part of embedded toolchains, but they seem to have more or less disappeared. They always had a few limitations, in areas like recursion, but they would know when they could not give a clean answer, and say so.

When the 8086 was shiny and new, I was programming for it in Intel's PL/M86. That compiler and linker gave out a stack depth analysis at the end of every list file. Other toolchains were more like the above description of the AVR tool. Why have we gone backwards? :-\

Steve


Reply via email to