Guidelines and HOWTOs/Debugging: Difference between revisions

From KDE Community Wiki
(Fix broken link)
 
(14 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 
[[File:Mascot konqi-support-bughunt.png|thumbnail|right|Help [[Konqi]] to catch some bugs!]]
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 [[/Using Error Messages|error messages]].
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 [[/Using Error Messages|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.
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|Debugging with GDB]] for a detailed tutorial.
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|Debugging with GDB]] for a detailed tutorial.


== Tools ==
== Tools ==
; Valgrind
=== Valgrind ===
: [[/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!
[[/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) ===
 
[https://www.sourceware.org/gdb/ GDB] helps in debugging source code. GDB is a command line text user interface (TUI) application. Run <code>gdb --tui</code> for more TUI features such as a source code window. Graphical frontends are available (see below). See also the debugging tutorial [[/Debugging with GDB|Debugging with GDB]].


; The GNU Project Debugger (GDB)
=== Text user interface (TUI) frontends to GDB ===
: [http://sources.redhat.com/gdb/ GDB] helps in debugging source code. As GDB evolved over time it is recommended to use version 6.x. Graphical frontends are available (see below). See also the debugging tutorial [[/Debugging with GDB|Debugging with GDB]].


; KDbg and DDD
The Emacs text editor has [https://faculty.kutztown.edu/spiegel/debugging/debugprimer.htm M-x gdb], [https://www.gnu.org/software/emacs/manual/html_node/emacs/Starting-GUD.html gud], [https://github.com/realgud/realgud realgud].
: [http://www.kdbg.org/ KDbg] and [http://www.gnu.org/software/ddd/ DDD] are graphical user interfaces to GDB, which are able to set breakpoints, step through the code etc.


; MS Windows tools (Process Explorer, Console, WinDbg, DebugView...)
=== Graphical user interface (GUI) frontends to GDB ===
: More info on the [[Windows|KDE on Windows page]].


== Related Pages (Misc) ==
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.
 
=== Microsoft Windows tools (Process Explorer, Console, WinDbg, DebugView, Process Monitor, Depends, Ilspy etc.) ===
 
More information is available on the [[Windows|KDE on Windows page]].
 
== Related Pages ==
*[[/Debugging with GDB|Debugging with GDB]]
*[[/How to create useful crash reports|How to create useful crash reports]]
*[[/Using Error Messages|Logging in KDE applications]]
*[[/QML|Debugging QML]]
*[[Plasma/Debugging | Debugging Plasmashell and widgets]]
*[[KWin/Debugging | Debugging KWin X11 and Wayland]]
*[[/Shared Memory Usage in KDE|Shared Memory Usage in KDE]]
*[[/Shared Memory Usage in KDE|Shared Memory Usage in KDE]]
*[[/Using Error Messages|Using error messages (kDebug)]]
*[[/Debugging symbols|Debugging symbols]]
*[[/Debugging with GDB|Debugging with GDB]]
*[[/Valgrind|Debugging with Valgrind]]
*[[/Valgrind|Debugging with Valgrind]]
*[[/KCM|Debugging KCM (System Settings modules)]]
*[[/Debugging IOSlaves|Debugging IOSlaves]]
*[[/Debugging IOSlaves|Debugging IOSlaves]]
*[[/MS Windows|Debugging on MS Windows]]
*[[/Debugging KIO Workers|Debugging KIO Workers]]
*[[/DrKonqi|Debugging DrKonqi (the KDE crash handler)]]
*[[/Linker_Errors|Debugging linker errors]]
*[[/MS Windows|Debugging on Microsoft Windows]]
*[[KDE/FAQs/Debugging_FAQ|Debugging FAQ]]
*[[KDE/FAQs/Debugging_FAQ|Debugging FAQ]]
*[[/How to create useful crash reports|How to create useful crash reports]]
*[[/Debugging symbols|Debugging symbols]]
*[[PIM/Akonadi/Debug_IMAP | Debugging IMAP for Akonadi/KMail]]
*[[Baloo/Debugging | Debugging Baloo and search]]
*[[/Phonon|Debugging Phonon]]
*[[/Phonon|Debugging Phonon]]
 
*[https://fedoraproject.org/wiki/KDE/Debugging Fedora wiki on debugging KDE]
[[Category:Programming]]

Latest revision as of 18:24, 26 October 2024

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.

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