3

I try to understand how variables in a c code influence each other. I was searching for hours for a tool. Doxygen, etc will give me call graphs (“which function calls whom?“), but does not provide information on specifically the variables/data. A dependency matrix generated from source code would help for example.

How can I best visualize this?

murph_sof
  • 83
  • 4
  • I have *never* seen anything like that. Moreover, I highly doubt it is possible for C (well, maybe just partially) as the same object can be accessed in some non-obvious and not visible to implementation ways. – Eugene Sh. Jul 10 '18 at 14:44
  • I guess this asks for the obvious ways i.e. which function is dependent on which symbol? – Antti Haapala -- Слава Україні Jul 10 '18 at 14:53
  • Apart from what @EugeneSh mentioned once you have code, use `cscope`, it gives all option including _which function calls whom_. – Achal Jul 10 '18 at 14:56
  • Regarding doxygen there are small possibilities. Global variables are shown by means of the setting of `REFERENCED_BY_RELATION = YES` and `REFERENCES_RELATION = YES`. It does not follow the variable when it is passed as an argument, just when it is used "plain" it is shown. You can see this in the HTML documentation but also in the xml output (`GENERATE_XML=YES`), the later can be used for some own processing. – albert Jul 10 '18 at 15:34
  • I am especially NOT looking for which function calls which other function! I need the information of how a specific variable affects other variables. So the solution is NOT a call graph like from doxygen (right?) – murph_sof Jul 10 '18 at 17:00
  • It is not a call graph it is just a list where the variable is used (when using REF...). – albert Jul 10 '18 at 17:29
  • Data is transferred between function via arguments and return values or via global variables. A function-call graph is the way to start but I know of no tool that shows global variables in them. – shawnhcorey Jul 20 '18 at 12:27

0 Answers0