[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Stack size question
From: |
Ned Konz |
Subject: |
Re: [avr-gcc-list] Stack size question |
Date: |
Mon, 28 Jun 2004 09:15:08 -0700 |
User-agent: |
KMail/1.6.2 |
On Monday 28 June 2004 5:36 am, John Yannakopoulos wrote:
> I have the following question: Can I determine the maximum stack size
> of my program? My at90s8535 resets and I suspect that a stack overflow
> occurs. Is there a tool (maybe from binutils) or some utility to check
> against stack size?
There is cflow, which works with AVR GCC pretty well:
$ cflow -X -D__AVR_ATtiny26__ -D_BV= -Dsei= -g ws2.c
ws2.c:2:20: avr/io.h: No such file or directory
ws2.c:3:27: avr/interrupt.h: No such file or directory
ws2.c:4:24: avr/signal.h: No such file or directory
ws2.c:5:23: avr/sleep.h: No such file or directory
1 SIGNAL {ws2.c 17}
2 setPhaseFrom10bit {dds.c 64}
3 stepDDS {dds.c 40}
4 main {ws2.c 76}
5 initializeIO {ws2.c 36}
6 timer_enable_int {}
7 set_sleep_mode {}
8 sleep_mode {}
There is also calltree:
http://www.ibiblio.org/pub/Linux/devel/lang/c/calltree-2.0.tar.gz
You will have to compile it yourself, though.
It can do this (you'll probably have to figure out how to change its include
path):
$ calltree ws2.c
<stdin>:2:20: avr/io.h: No such file or directory
<stdin>:3:27: avr/interrupt.h: No such file or directory
<stdin>:4:24: avr/signal.h: No such file or directory
<stdin>:5:23: avr/sleep.h: No such file or directory
SIGNAL:
_BV
setPhaseFrom10bit
stepDDS
_BV:
EXTERNAL ROUTINE
initializeIO:
_BV
sei
timer_enable_int
main:
initializeIO
_BV
sei
timer_enable_int
set_sleep_mode
sleep_mode
sei:
EXTERNAL ROUTINE
setPhaseFrom10bit:
set_sleep_mode:
EXTERNAL ROUTINE
sleep_mode:
EXTERNAL ROUTINE
stepDDS:
timer_enable_int:
EXTERNAL ROUTINE
However, neither of these take into account any inlining.