Are there any static code metrics tools that measure total size of static local variables in c functions. The tools that I explored report the stack size but not the size of the static local variables. Is there another option apart from using linux objdump and parsing the output?
Asked
Active
Viewed 165 times
0
-
On linux you can use [readelf](https://linux.die.net/man/1/readelf) for the executable image file and [pmap](https://linux.die.net/man/1/pmap) for the running process to see what's been allocated for what kind of use from a higher level memory footprint perspective. Usually things are done on page boundaries so you're not going to see anything super-tightly conforming to your specific memory footprint on a UNIX OS AFAIK. – clearlight Jan 31 '17 at 18:35
1 Answers
3
The POSIX size
command can be used for this purpose. The size of the data section is the size of all data in static storage (except data declared const on some targets).

fuz
- 88,405
- 25
- 200
- 352