Fun with graphs

So I figured that I would post some of the progress with EDB. I’ve been very happy with the function analysis engine that I developed, but there is one thing that it completely ignores basic block analysis. Of course, in order to identify functions it does technically break things down into blocks, but this information is discarded when a whole function is identified.


The main reason for this is that I had no real practical way to display this information in a useful way to users. A list of blocks wouldn’t do, there would simply be too many for anyone to make sense of them. Some other tools have a nice solution though…graphs :). So I figured that it’s time EDB got a graphing plugin of sorts. And that’s where my focus has been lately. Finally, after playing with the awesome QGraphicsView API, I have some results that are worth noting.

edb_graph1

As you can see, it is looking pretty nice. All of the nodes are draggable so if you don’t like how it is laid out, you can adjust it. Of course, it isn’t quite ready yet, otherwise, I would have just tossed it into EDB and bumped the version. There are two major things I need to figure out.

  1. How big do I make the whole scene? Right now I just go with “very big”, but eventually, I’ll have to figure this out based on the content. This is very dependent on issue #2 though…
  2. I have no automatic layout engine. Currently, in my test code, I’ve manually placed each node. This is likely to prove very difficult, but I’ll get there (Obviously if any graph experts out there want to help, feel free to email me ;-)).

Beyond that, I’m feeling pretty good about how it works.

You may be wondering why I didn’t just use GraphViz. Well, to be honest, I looked into it. But there didn’t seem to be any nice and simple way to get the results into a Qt widget. As far as I can tell, the API revolves around programmatically generating a .dot file, sending that through one of the Graphviz renderers, and then taking the output file and finally displaying it. I don’t like all the temporary files and the dependency on external programs. I’m not a fan of “front-ends” in general, otherwise, EDB would just be another GDB front end.

Though if I could do a pure library solution, I could work with the temporary files. Obviously, I could have missed something in Graphviz, if so, let me know :).

I hope to have things nice and ready for release soon.