•
Interactive debugging uses debugger tools which allow a program's execution to be processed one step at a time and to be paused to inspect or alter its state. Subroutines or function calls may typically be executed at full speed and paused again upon return to their caller, or themselves single stepped, or any mixture of these options. Breakpoints may be installed which permit full speed execution of code that is not suspected to be faulty, and then stop at a point that is. Putting a breakpoint immediately after the end of a program loop is a convenient way to evaluate repeating code. Watchpoints are commonly available, where execution can proceed until a particular variable changes, and catchpoints which cause the debugger to stop for certain kinds of program events, such as exceptions or the loading of a shared library. • ''
or tracing'' is the act of watching (live or recorded) trace statements, or print statements, that indicate the flow of execution of a process and the data progression. Tracing can be done with specialized tools (like with GDB's trace) or by insertion of trace statements into the source code. The latter is sometimes called '''', due to the use of the
printf function in C. This kind of debugging was turned on by the command
TRON in the original versions of the novice-oriented
BASIC programming language. TRON stood for, "Trace On." TRON caused the line numbers of each BASIC command line to print as the program ran. •
Activity tracing is like tracing (above), but rather than following program execution one instruction or function at a time, follows program activity based on the overall amount of time spent by the processor/CPU executing particular segments of code. This is typically presented as a fraction of the program's execution time spent processing instructions within defined memory addresses (machine code programs) or certain program modules (high level language or compiled programs). If the program being debugged is shown to be spending an inordinate fraction of its execution time within traced areas, this could indicate misallocation of processor time caused by faulty program logic, or at least inefficient allocation of processor time that could benefit from optimization efforts. • '''' is the process of debugging a program running on a system different from the debugger. To start remote debugging, a debugger connects to a remote system over a communications link such as a
local area network. The debugger can then control the execution of the program on the remote system and retrieve information about its state. •
Post-mortem debugging is debugging of the program after it has already
crashed. Related techniques often include various tracing techniques like examining log files, outputting a
call stack on the crash, and analysis of
memory dump (or
core dump) of the crashed process. The dump of the process could be obtained automatically by the system (for example, when the process has terminated due to an unhandled exception), or by a programmer-inserted instruction, or manually by the interactive user. •
"Wolf fence" algorithm: Edward Gauss described this simple but very useful and now famous algorithm in a 1982 article for
Communications of the ACM as follows: "There's one wolf in Alaska; how do you find it? First build a fence down the middle of the state, wait for the wolf to howl, determine which side of the fence it is on. Repeat process on that side only, until you get to the point where you can see the wolf." This is implemented e.g. in the
Git version control system as the command
git bisect, which uses the above algorithm to determine which
commit introduced a particular bug. •
Record and replay debugging is the technique of creating a program execution recording (e.g. using Mozilla's free
rr debugging tool; enabling reversible debugging/execution), which can be replayed and interactively debugged. Useful for remote debugging and debugging intermittent, non-deterministic, and other hard-to-reproduce defects. •
Time travel debugging is the process of stepping back in time through source code (e.g. using
Undo LiveRecorder) to understand what is happening during execution of a computer program; to allow users to interact with the program; to change the history if desired and to watch how the program responds. •
Delta debugging a technique of automating test case simplification. •
Saff Squeeze a technique of isolating failure within the test using progressive inlining of parts of the failing test. •
Causality tracking: There are techniques to track the cause effect chains in the computation. Those techniques can be tailored for specific bugs, such as null pointer dereferences. •
Shotgun debugging: a process of attempting to correct a bug by making largely undirected source code modifications, sometimes resulting in further problems.
Automatic bug fixing ==Debugging for embedded systems==