开发者

How to get maximum frame size of each function compiled by gcc?

开发者 https://www.devze.com 2023-04-03 10:58 出处:网络
Is it possible to get maximum frame size of each function compiled by GCC? I have a bunch of C 开发者_如何学运维and C++ source files in my project and I want to have a statistics of stack usage of eac

Is it possible to get maximum frame size of each function compiled by GCC?

I have a bunch of C 开发者_如何学运维and C++ source files in my project and I want to have a statistics of stack usage of each function, just couldn't find any related options in GCC manual.


You can try -fstack-usage.

  • https://gcc.gnu.org/onlinedocs/gnat_ugn/Static-Stack-Usage-Analysis.html

There is also -Wstack-usage=<stack_limit> (eg. -Wstack-usage=4096) which will give you a warning as you compile your code.

0

精彩评论

暂无评论...
验证码 换一张
取 消