Skip to content

New Debugging Utility in kdesdk

Thursday, 3 May 2001  |  Rmoore

Debugging code is always a pain in the neck, but there's a tiny new utility in kdesdk which might make things a little less stressful. The utility, KSpy, gathers information about the state of a running KDE application and displays it graphically. Read more below.



The core of KSpy is a tiny library which displays a tree of all the QObjects in an application. Selecting an object allows you to view its properties, and the signals and slots it defines. This information is already available to developers via the Qt methods QObject::dumpObjectTree() and QObject::dumpObjectInfo(), but their output is not particularly convenient (and sends a lot of messages to the console if you forget to remove it!). KSpy has only minimal overhead for the application, as the kspy library is loaded dynamically using KLibLoader. You can see a picture of the KSpy probing it's own test program in this screenshot.

To use KSpy from your code, first build and install kdesdk/kspy, include the header kspy.h, and finally call KSpy::invoke() when you want to run the probe. You can easily wrap this call in a slot so it can be bound to a keystroke or an action. In the future, KSpy will probably gain a few more abilities such as the ability to watch the events an object receives and the ability to see which config files are in use, but it should be pretty useful already.

While you're looking at KSpy, you should check out some of the other goodies in kdesdk - this module has a whole host of tools for developers:

  • KBabel
    A tool for application translators which makes it easy to edit .po files.
  • KAppTemplate
    A script that can generate the basic framework for a KDE application.
  • KMTrace
    A memory leak hunting tool.
  • KStartPerf
    A tool for measuring app startup times.
  • Scripts
    Scripts for tasks such as packaging an app from CVS, updating your local copy of KDE and more.

Comments:

Cool - compile lazy - 2001-05-03

This is amazing: Integrate this and something like gvd and qtdesigner into Kdevelop and you have the equivalent of Borlands C++ Builder*. I hope the next beta rpms come out soon! * maybe all these things are already integrated, since I still do the layout by hand, maybe I am talking BS. I even have to start make myself familiar with tmake, since maintaining my makefiles by hand starts to take to much time.

Re: Cool - Eric Laffoon - 2001-05-03

Sigh... then again if people followed KDE news... well, maybe that would take all their time. ;-) Here's the deal. First there are two good tools for KDE, Kdevelop and (theKompany) Studio. Second QT Designer is integrated in Kdevelop and third... this will all be old news soon. The new Kdevelop is called Gideon and it is under development to work with mulitple languages. For instance if you want to work with Java there are full Java bindings for KDE and Gideon is equiped to develop Java. Also on the horizon is QT 3. In the next version there will be a number of new widgets along with an improved QT Designer. The next version of QT designer will be able to work on the full UI not just dialogs among other improvements. In case you're not putting this all together... the Kdevelop of the not too distant future will have an ingetrated RAD GUI tool for your entire interface and allow you to choose from a number of languages to develop while offering such advanced widgets as rich text tools, data access widgets and anything else in QT and kdelibs. Interestingly you can look at all this stuff if you are not afraid of CVS or FTP and a compile. ;-) Instead of hypothesizing you could be making the future. ;-)

Re: New Debugging Utility in kdesdk - Daniel - 2001-05-03

I want to know if there are proyects or some roadmap that says that KDE-Designer (Qt-Designer) or a GUI-Builder will be integrate into Kdevelop. I think that Kdevelop need some GUI-Builder (alo Glade) to be the definately RAD por writte aplications for KDE and for others languajes and plataforms (gtk, gnome, java, tcl/tk, etc...).

Re: New Debugging Utility in kdesdk - Carbon - 2001-05-03

QT Designer is alredy integrated into KDevelop. As for multiple languages, check out the comment above on Gideon. This is why i love OSS. Make any feature request on a public msg board and most of the time your answer is "already under development, look for it in a couple of releases" :-)

Re: New Debugging Utility in kdesdk - Daniel - 2001-05-04

Are you sure that Qt-Designer is already integrate into Kdevelop? I mean, two diferent applications (kdevelop and Qt-designer) that can interoperate together or one application named Kdevelop that has a GUI-designer (alo Borland C++ Builder)? And if Gideon will have multiple languages, will be able the GUI-Builder for the new languages? I mean, a GUI-Builder for Java por example, using the Java widgets .... Thanks :-) Daniel

Re: New Debugging Utility in kdesdk - Carbon - 2001-05-04

Kdevelop and Qt-Designer are seperate apps, but Qt-Designer can be configured to use KDE widgets, and it outputs xml gui files, which you can then load with a bit of code, afaik. Any kde app, including those built with another language that has been bound to kde, should be able to load those files. I don't know about other lang's widgets.

Re: New Debugging Utility in kdesdk - mentat - 2001-05-03

there is any code complete project to kdevelop?

code completion - ac - 2001-05-04

there is something in kdestudio by thekompany. There are at least plans for kdevelop. Hava a look at the mailinglist

code completion - ac - 2001-05-04

there is something in kdestudio by thekompany. There are at least plans for kdevelop. Hava a look at the mailinglist

code completion - ac - 2001-05-04

there is something in kdestudio by thekompany. There are at least plans for kdevelop. Hava a look at the mailinglist

Re: New Debugging Utility in kdesdk - Jono - 2001-05-04

AFAIK the code completion support is well on the way in KDevelop, although there has been some discussion of how the new gcc can help. Don't quote me on this as I am not a KDevelop developer...just what I picked up. Check http://lists.kde.org/ for more info. Jono