This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: show size of stack needed by functions


Apologies for continuing the somewhat off-topic thread...

Sebastian <sebastianspublicaddress@googlemail.com> writes:
> Static analysis which work on source code are not ideal, either. They
> don't know which functions will be inlined by the compiler.

I'm pretty sure that the Linux kernel developers have some scripts
that parse object files to determine deepest stack usage.  Here it is,
the "checkstack" target in the makefile:

checkstack:
        $(OBJDUMP) -d vmlinux $$(find . -name '*.ko') | \
        $(PERL) $(src)/scripts/checkstack.pl $(CHECKSTACK_ARCH)

The script itself can be viewed here:

   http://preview.tinyurl.com/3x7bgw4

HTH,
t.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]