is there any tools that can extract all variables(both public and static) from a set of C files?
I'm wondering if there is any tools that can extract all variables(both public and static) from a set of C files and then export all referenced variables to a text file.
Thanks in advance.
Doxygen does this pretty well (here are some examples). ctags does this too but I haven't really played with it much aside from using it in vim. I'm sure the tags file can be made parseable.
You can try CScope
More info here
Not sure this will help you but that would be easy to do with Cil from http://www.eecs.berkeley.edu/~necula/cil/index.html the problem is you will need to learn OCaml to use it. (Some people might consider that a feature.)
The Unix nm(1) on the binary may be helpful. And I used cxref about 15 years ago.
精彩评论