There is no such thing as perfect software without bugs. Daily optimisation is therefore indispensable. Here, the big problem often lies not in finding faulty processes in the programming sequence, but in determining their exact cause. Even just a mispositioned bracket or an incorrectly used operator can result in a program no longer functioning properly. In the case of hundreds or even thousands of lines of code, manual searches performed row by row offer little prospect of success. For this reason, modern debugging tools not only provide information that a problem has been determined, but also offer extensive details on the type of error and which code lines contain the error.
Normally, debuggers work through the program code in a step-by-step manner. Breakpoints are, therefore, defined in the software to be debugged. The debugging tool recognises these breakpoints and can use them to stop running the software at exactly these points. For developers, this opens up the following two possibilities:
- It is possible to examine the exact state of the program at this time. For instance, it is easy to check whether all integrated variables have output the expected values.
- It is possible to play the program from the respective breakpoint to delineate any problems or sources of errors.
The breakpoints do not need to be fixed. Many debuggers allow breakpoints to be tied to individual conditions. This way, the program can stop under certain circumstances. For example, if a loop undergoes 20 passes correctly and only encounters a program error on the 21st pass, the debugger can launch directly into the problem case thanks to a corresponding condition. In other words, the previous incident-free passes do not need to be repeated.
The other functions of debuggers include the inspection of data, such as the content of variables, repositories or registers, as well as the modification of memory, such as the main storage (working memory) or the processor register.