List of function calls in static code analyzer tools

799 views Asked by At

In an embedded C project which is using a SDK's source and header files, I want to have a list of functions, definitions, and variables that a specific source file is using across the project. In other words, a tool that statically analyzes and lists dependencies of a specific source code without the need to execute functions ( not dynamic) of the source file.

I checked static code analysis tools, but they are mostly linters and do not give me a list of dependencies.

I think this type of work is not being explored by the community and any answer will help a lot.

Thanks

1

There are 1 answers

0
James from CppDepend Team On

You can try CppDepend and its code query language, here's an example of a cqlinq query to get all methods with their files used by a source file.

from m in JustMyCode.Methods where  m.SourceDecl.SourceFile.FileName=="test.cpp"
from mc in m.MethodsCalled
select new { m,mc,mc.SourceDecl.SourceFile.FileName}