Search code examples
cvariablesdependenciesextern

Show dependencies of global variables in C code


I'm analysing an existing C code project which uses global variables a lot (extern keyword). My problem is that the keyword is not only used in the .h files of the depending variable but also in other .c files wherever there is need to access a variable.

Is there a tool which allows me to select a variable and see all the accesses across the project (selection of .c files)?

I know that there is the possibility to use the search function every time but I'm dealing with around 400 extern keywords so I won't do anything else than searching.


Solution

  • Within Eclipse: rightlick a variable -> Open call hierarchy

    This shows all the accesses of this variable for the whole project (excluding the declarations)

    I will keep my eyes open for a feature like this listing all the variables of a module.