Hi all,
Is there a way to access the frame size of a function from C in the C2000 compiler?
Of course I can manually count the local variables, but this is error-prone and I would like to have this done automatically.
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi Stephan
I've seen somewhere that C2000 compiler now (mayber from 5.1 or 5.2.x forward) supports some GCC extensions. "__builtin_frame_address" might be in your direction. Though if we could get an updated "TMS320C28x Optimizing C/C++ Compiler User's Guide" (the one available is almost three years old) one could maybe find there are additional features that just have not been documented yet.
Regards, Mitja
Hi Mitja,
yes, __builtin_frame_address could be okay, but the latest compiler guide spru513c.pdf says, it always returns 0.
I did not get it to work.
I totally agree with you that this document should be updated (it is not only 3 years old, it still is preliminary!!)
__builtin_frame_address still returns 0. When that changes, expect to see it here first http://tiexpressdsp.com/index.php/C2800_Optimizing_C/C%2B%2B_Compiler_Errata .
I don't see how you could use __builtin_frame_address to determine the size of the frame. That function returns the base address of the frame.
Thanks and regards,
-George
You would need to additional function, call it, get its frame address, and then subtract the frame address of the caller function from the frame address of the called function
Mitja