Call graph
-
Do you know a plugin that can create a call graph (dependency graph) for the functions (methods etc) in a program file, or in the entire program?
I could not find that in the list of plugins at https://github.com/notepad-plus-plus/nppPluginList ,
(searching for “call graph” or “dependency” and similar),
but I thought maybe one of plugins can do it, among several other things, and that’s why it doesn’t show up in their names.If not, do you use some other call graph tool that can be integrated in or called from Npp?
(What are call graphs: https://en.wikipedia.org/wiki/Call_graph )
-
@Victorel-Petrovich said in Call graph:
Do you know a plugin that can create a call graph (dependency graph) for the functions (methods etc) in a program file, or in the entire program?
No plugin I know of. Have a look at Sourcetrail. It’s discontinued but I find it still works basically for C/C++ and Python. There is no specific Notepad++ integration but it can be set up through it’s API. Though integration is really just jumping to the file/function from the standalone Sourcetrail program to the editor you set up.
Cheers.
-
@Michael-Vincent
Thanks, I just tried it; can do a lot more than I asked.
You’re probably right, it doesn’t need to be integrated with an editor; rather, it would need integrated with the compiler / build environment.Unfortunately, I found it too complicated to set up a project properly. Need to know similar info as when compiling a project.
Have you tried it on Notepad++'s sources?
It gives me like hundreds of Fatal errors, when indexing. Then it builds some call graphs, but for some functions, it is incomplete (probably because of the errors).
I should search a simpler tool I guess .
-
@Victorel-Petrovich said in Call graph:
Have you tried it on Notepad++'s sources?
No.
It gives me like hundreds of Fatal errors, when indexing.
Yes, I’ve seen that too depending on the project I’m profiling. The errors should not prevent it from completing, you just may not have the full set of paths as you would if all libraries / dependencies were found. I ran it against a Linux code base on my Windows machine so you can image many headers were missing, but it still have a pretty good call graph of the main program.
Then it builds some call graphs, but for some functions, it is incomplete (probably because of the errors).
See previous comment. Probably correct / valid assessment, but depending on your use case, it could still be beneficial.
Unfortunately, I found it too complicated to set up a project properly.
I didn’t think it was that hard, but then again, it was certainly easy to make mistakes and get invalid output. Shame it is no longer supported / developed.
Cheers.
-
@Michael-Vincent
Another reason could be that I could only use the oldest release there (2years ago, for Win 32bit).
So other people, and with more experience than me, could well have success. -
In the past I used doxygen for creating call graphs of C code. It supports
C/C++, Lex, Java, (Corba and Microsoft) Java, Python, VHDL, PHP IDL, C#, Fortran, Objective-C 2.0, and to some extent D sources.
It uses the dot tool of the Graphviz tool kit by AT&T Research to generate nice call graphs. When I played around with it some years ago it was able to generate a *.chm file as output (using Microsoft’s HTML Help Workshop’s hhc.exe). But I haven’t used it for a long time, so I don’t know anything about its current features. At least, it still seems to be under active dvelopment.
-
@dinkumoil thanks, I will try it.