Guidelines and HOWTOs/Debugging

From KDE Community Wiki
Revision as of 13:24, 2 February 2023 by Nmariusp (talk | contribs) (Only two wiki pages in Category:Programming)
Help Konqi to catch some bugs!

Debugging KDE applications can be done on different levels. Most applications "talk" invisibly through debug log 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 an IDE which makes it simple to use gdb. Read Debugging with GDB for a detailed tutorial.

Tools

Valgrind

Valgrind helps to find memory leaks and uninitialized memory blocks. Additional features are a profiler and more. Valgrind is one of the most important development tools!

GNU Debugger (GDB)

GDB helps in debugging source code. GDB is a command line text user interface (TUI) application. Run gdb --tui for more TUI features such as a source code window. Graphical frontends are available (see below). See also the debugging tutorial Debugging with GDB.

Text user interface (TUI) frontends to GDB

The Emacs text editor has M-x gdb, gud, realgud.

Graphical user interface (GUI) frontends to GDB

Integrated Development environments (IDEs) such as Qt Creator, Microsoft Visual Studio Code, KDevelop, JetBrains CLion etc. contain a debugger which is a GUI wrapper over GDB.

There are other applications which are GUI frontends to GDB such as KDbg.

Microsoft Windows tools (Process Explorer, Console, WinDbg, DebugView, Process Monitor, Depends, Ilspy etc.)

More information is available on the KDE on Windows page.

Related Pages