This year I’ll be working on Pidgin for Summer of Code, and I’m hoping to replace GtkIMHtml with Webkit.
As always, learning the source code takes a significant amount of the time, and so I created this small little tool to help me in the process. I had started this a while back, and completed it today, and thought I’ll share it.
What it does: after building the project, you have lots of “.o” files lying around. These “.o” files have very useful information about the symbols that it exports, and the symbols that it uses from elsewhere. This immediately gives me a very clean way to track dependencies. (The other way is to use header files. Well… )
As a second step, I don’t like cyclical dependencies. I personally like to keep cyclical dependencies to a minimum. In fact, while trying to understand code, it makes more sense to think of an entire strongly connected component of modules as one single component.
So my code just finds the SCC graph, and then topo sorts them to display the final dependency graph very neatly. It gives a quick overview of the code layout. (And can probably be used as a tool to remove cyclical dependencies.)
Here’s a git repo: http://opc.iarcs.org.in/public/repo/arnold/depgrapher.git (Quick git HowTo: git clone <url>)
(For the contest coders: this is written in C, and uses n^2 algorithms everywhere. :P Messy code.)
What I’d like to do: I’d like to display the DAG GUI-ily—in the way gitk shows the commit graph. (I could just take graph drawing code from git, but I don’t have the time.)
Is there already a tool to do this? If not, contributions welcome.