tags:

views:

63

answers:

4

Hi Guys,

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.

+2  A: 

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.

nevets1219
+1  A: 

You can try CScope

More info here

Jujjuru
A: 

The Unix nm(1) on the binary may be helpful. And I used cxref about 15 years ago.

Joseph Quinsey
+1  A: 

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.)

Ukko