Development/Tutorials/Debugging: Difference between revisions

From KDE TechBase
m (mention kdevelop)
(start to merge http://developer.kde.org/documentation/other/debugging.html)
Line 1: Line 1:
In order to understand an application or find bugs it is useful to trace the code paths and get backtraces. There are several ways to do it:
Debugging KDE applications can be done on different levels. Most applications "talk" invisibly through debug statements while they are running. Looking at this information mostly gives you enough info to find out what went wrong. For further details, read the dedicated article about [[/Error Messages|error messages]].
* insert kDebug statements to trace the course of the program
 
* use [[../Debugging with GDB|gdb (tutorial)]]
On a different level we have post-mortem debugging. This is used ''after'' an application died, probably because of a programming error. The drkonqi dialog allows you to create a '''backtrace''', and possibly find out where it went wrong.
* use a graphical frontend like [http://www.kdevelop.org KDevelop] or [http://kdbg.org/ KDbg], see also the [[../../Tools|tools pages]]
 
There are debuggers like gdb which can do a lot more than just find out where it went wrong. You should read the man page of gdb to find out more, and possibly download 'kdbg', 'ddd', or 'inspire' which make gdb a lot simpler to use. Read [[../Debugging with GDB|Debugging with GDB]] for a detailed tutorial.
 
== Further Details ==
todo: mention
* valgrind
* [http://www.kdevelop.org KDevelop] or [http://kdbg.org/ KDbg], see also the [[../../Tools|tools pages]]

Revision as of 17:46, 29 December 2006

Debugging KDE applications can be done on different levels. Most applications "talk" invisibly through debug statements while they are running. Looking at this information mostly gives you enough info to find out what went wrong. For further details, read the dedicated article about error messages.

On a different level we have post-mortem debugging. This is used after an application died, probably because of a programming error. The drkonqi dialog allows you to create a backtrace, and possibly find out where it went wrong.

There are debuggers like gdb which can do a lot more than just find out where it went wrong. You should read the man page of gdb to find out more, and possibly download 'kdbg', 'ddd', or 'inspire' which make gdb a lot simpler to use. Read Debugging with GDB for a detailed tutorial.

Further Details

todo: mention