We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi Experts,
What is the way to identify the static stack frame size of the each routines in the C program ?
For example, in GCC ARM mode compiled c program the disassembly code is generated and in that there will be an instruction as follows
sub sp,sp, #10
where #10 is the stack frame size of the routine.
But in case of thum mode compilation or arm-thumb interworking, I am unable to find this instruction rather it is formed as
push/mov.w instructions.
Is there any tool or way to detect the static stack frame size of each routines ?
I can't answer for the GNU tools, but if you're using DS-5, armlink has the --callgraph option (<-that's a link) which uses the .debug_frame info (which is typically present in the object files even when not building debugging) to give the stack size information.
Also this thread might get more attention in the Software Development Tools section.
Hi,
Here there is some information about the ARM Stack
You'll have to use a : "gcc -S" to get assembler output from your C programs directly
Hi Scott,
Thats great info from DS-5 ARMCC.
Well i am bit comfortable with decoding the debug sections the ELF file. I might try to chase it using readelf right from the .debug_frames details.
Thanks for the reply.
Regards,
Techguyz