KDevelop Felhasználói Kézikönyv -Fordítás alatt: Referencia Kézikönyv a Unix operációs rendszer alatt futó KDevelop Integrált Fejlesztői Környezethez, 1.0 Verzió | ||
---|---|---|
Vissza | Fejezet 3. Programok | Tovább |
The following section covers a term that is widely used by developers: Debugging. It means, that, although your Compiler produces the final application, your application may not run or crash during execution due to a so-called "bug" in the code. A program error described by the name of this insect comes from the history of computing; one of the first errors that caused a machine to crash was not obviously a malfunction- bugs were inside the computer which were responsible for it. Therefore, an error not detectable on the first look is called a "bug", so "debugging " means to throw out bugs where they shouldn't be. Now, you don't have to hunt them for real; assuming that today's computers are designed to keep them out by some kind of outer protection. They have to be found inside the code, mostly ending the execution of a program with the message "Segmentation fault". GNU provides another tool called gdb, the GNU debugger. This terminal program allows to watch the internal values of an application and the execution step by step with setting "breakpoints" in the code. Gdb stops the execution every time the program comes to a breakpoint while executing. But like most other tools, the debugger is handled by another program providing a frontend to it, allowing to easily watch values and the setting of breakpoints in the code.
For this purpose, your project's application is by default created with a Compiler option for debugging , thereby storing additional data in the executable to allow the localization of values and lines in the code. As a third-party frontend to gdb, KDevelop makes use of KDbg , the KDebugger. To debug your program, you just have to select "Debug" in the Build-menu or press the according toolbar button displayed by a wheel having glasses over it, signaling that you want to watch the execution.
KDevelop then opens the Tools -window and starts your application with KDbg . The KDbg interface appears inside the Tools -window and allows the usage just like you started it from outside.
In general, the above steps are clearly showing the need of certain steps that a developer has to do when starting to write his own application, and cover issues that are common to all projects. Also, we explained what part KDevelop does for a developer and how it supports the idea of providing an easy way to Unix programming. To get further information about the role and purpose of GNU tools, you should read the documentation provided with them, commonly accessed via the man command or by the "System GNU Info contents" section in KDEHelp.