In computer programming and software development, debugging is the process of finding and resolving bugs (defects or problems that prevent correct operation) within computer programs, software, or systems. Debugging tactics can involve interactive debugging, control flow analysis, unit testing, integration testing, log file analysis, monitoring at the application or system level, memory dumps, and profiling. Many programming languages and software development tools also offer programs to aid in debugging, known as debuggers.
The overall approach to debugging might vary depending on the application.
The main techniques are:
- Source-code level debugging features are found in most modern general-purpose programming languages, because source code is typically the only information available to debug other than machine code or bytecode.
- Symbolic level debugging refers to use of “symbolic” information, which is metadata attached to a program’s source-code.
- Bytecode level debugging involves debugging of compiled code from an early stage in the compiler when the code is represented as bytes or octets with each byte corresponding to one operation code (opcode) that may be either assembled into machine code or interpreted by another software component.
- Debugging of compiled bytecode is typically faster than source-level since it may not involve switching out of the compiled code.
- This is particularly useful when analyzing malware, where debuggers can attach to an already running process to examine internal state or memory directly.
- For example, line numbers are displayed, subscripts of variables are printed as if they were arrays, and software breakpoints (for example setting a memory cell to read or write) are supported.