KDE runtime observer

Pourpose:

This framework help to debug Qt/KDE applications by showing very easily runtime relations between objects: Signals, heritage, containment...

From my initial study of the framework, i see that some features will only need a special library at compile time (maybe an so with LD_PRELOAD can be used), while other may need a special moc. I will mark the second type with an #.

For example, the easiest application should be to know which connections between signals and slots exist. It should be able to display the data by looking for classes, for specific objects, and so on.

Also it should be able to display the "parent" of each QObject, and show a tree with the names, with some extra addons like grouping: if you have a hundred of identical QLabels, it should show only one, and state there are a hundred like that one.

# Also it could be great to display in some kind of graph when the running application sends a singal, and how it propagates. This coud be also with a time line, where we can move a slide or event list, and watch how conenctions appear and disappear (creating green lines, for example), and events flow (blue lines, for example), on all the objects or a subset of them.

If the source code is preprocessed it should be able too to list heritage of each object, and all avaliable signals and slots.

Also statistics can be created to know how many times a specific connection/signal/slot is used.

More KDE-centric features could include a special list for KActions, DCOP and many more things you could imagine.

As you can see the idea is to create just an observer of the runtime relationships of the objects in Qt. I think, from my peronal experience that this can help a lot finding bugs, extrange loops, and in general to keep clean the signal/slots flow.

Implementation:

The implementation, as said, should need at least two parts, some other will exist, but they only add extra functionality. The more important one is at the first two points:

  1. a special library that should just copy to a pipe information as objects are created/destroyed, and as connections are performed.
  2. One gui to see all this. There are several options for it:
    1. It can be programmed as a stand alone program, maybe in python. Easier and faster development
    2. C++. I'm more used too, but development might be slower, I think
    3. A final option, and maybe the better is a Kdevelop plugin. This option looks as the best one, but I'm not used at all with plugin development for kdevelop, so maybe this will be the slower.
  3. modify the moc (this is a maintenance problem, as we should be in sync) to add lines to the signal emit method and to the slot reception method to make them write some data to the pipe. Maybe this can be done with a trick: change also the signalsBlocked function, and watching the stack.
  4. a preprocessor to obtain a list of heritage, and all avaliable signals/slots. I dont know if I could get this from doxygen or similar generated docs. I'm not sure if the list of signals slots could be get also changing some function like setMetaObject.

I've done preliminary study of the library thing, and works as expected.

License.

GPL, of course. Mainly beacuse it's the license I most like, and beacuse I have to get some code from the Qt sources.

About Myself.

My full name is David Moreno Montero, 24 years old I study computer science at Universidad Autonoma de Madrid, Spain (http://www.uam.es or http://www.ii.uam.es).

My main KDE connection is at KMiditracker (http://www.monasteriomono.org/programs/kmiditracker), a MIDI step sequencer for KDE, but I also do some other programs at my spare time.

[ Edit ]