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.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can try
-fstack-usage.There is also
-Wstack-usage=<stack_limit>(eg.-Wstack-usage=4096) which will give you a warning as you compile your code.