Created
January 21, 2020 20:03
-
-
Save rzymek/13901235c2c589c4261e61f78798991e to your computer and use it in GitHub Desktop.
Intellij Idea Call Hierarchy to graphviz dot file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # awk -f call-hierarchy-to-graph.awk call-stack.txt |dot -Tpng -o call-stack.png | |
| BEGIN { | |
| print "digraph {" | |
| path[-1]="start" | |
| } | |
| { | |
| depth=(match($0, /[^ ]/)-1)/4; | |
| gsub(/^ +/,"") | |
| match($0, /[^)]*[)]/, funcWithArgs) | |
| match($0, /[^(]*/,funcOnly) | |
| this=funcWithArgs[0] | |
| #this=funcOnly[0] | |
| #this=$0 | |
| from=path[depth-1] | |
| to=this | |
| lines[" \"" from "\"->\"" to "\""]++ | |
| path[depth]=this | |
| } | |
| END { | |
| for (line in lines) { | |
| print line ";" | |
| } | |
| print "}" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment