Back in the days, we did not have capabilities to find and install debug packages with Dr. Konqi in KDE. But those times are over!
Debug packages are important, well, actually very important. When an application crashes it is in most cases possible to create a so called backtrace. A backtrace ideally provides the developer with the precise location in the source code where the crash happened. Fixing a crash without this kind of information is almost impossible, and the more information are available in the backtrace the better. Debug packages contribute to this in that their content are debug symbols, essentially those are the references that are used in the backtrace. Now, usually you do not need to have this information to use the software, which is the reason a lot of distributions strip the symbols into these seperated debug packages (one can save a big deal of disk space by removing them).
In case you did not yet hear of Dr. Konqi. It is a very useful tool that usually pops up when a KDE application crashes. It then tries to get all information necessary for you to create a perfectly useful bug report.
There is big of a problem, on the one hand you do not want to waste disk space and network traffic for these debug symbols, even though like 99% of the regular users will not need them, and on the other hand you have Dr. Konqi which is trying to obtain a high quality backtrace that enables developers to quickly process a bug report and fix a crash in their software.
Not KDE 4.4not GNOME 3.0 and not KDE SC 4.4but Dr. Konqi 2.1 comes to rescue and now allows distribution developers to create scripts that take care of the find an installing of debug packages, so that the debugging experience becomes a bit better. Well, obviously debugging is not much of a user experience eitherway😉 but at least getting a backtrace is now more barable than it was before.
The system is quite simple. Dr. Konqi calls an executable, passing it all files for which no debug symbols were found for as arguments, then the executable tries to find and install the appropriate packages and returns back to Dr. Konqi. Straight forward really🙂
Since I am, amongst other things, Kubuntu developer and since this blog post is tagged ‘kubuntu’ of course I am only blogging about this because Kubuntu today got support for this fancy new feature😉. Should you encounter a crash in upcoming Kubuntu 10.04 Dr. Konqi will not only tell you how good the quality of the automatic generated backtrace is, but also show a button with which you can install missing debug symbols.
Additionally I might mention that Kubuntu has a new mantra of using C++ whenever possible (in opposite to the former one, which was to use Python whenever possible), hence the application standing behind this new features is written in C++ and got the fancy name kubuntu-debug-installer.
In case you care, the code is available on launchpad, and fairly simple. It really just creates a thread and uses dpkg -S to find the appropriate packages. In later versions it will also be able to use other means of looking up debug packages and be able to add a super secret Kubuntu repository for debug packages automatically, if necessary.
What I would like to see for future KDE releases is the possibility to directly tie a plugin into Dr. Konqi instead of having to create an independet application. But for now we’ll try to get kubuntu-debug-installer the ability to use different algorithms for finding the appropriate debug packages (also using different tools, since for example apt-file performs better than dpkg-query, but requires an up-to-date cache etc.) and of course support of a special Kubuntu repository that contains debug packages for all and every official Kubuntu package.