
A debugger is a
computer program
A computer program is a sequence or set of instructions in a programming language for a computer to Execution (computing), execute. It is one component of software, which also includes software documentation, documentation and other intangibl ...
used to
test
Test(s), testing, or TEST may refer to:
* Test (assessment), an educational assessment intended to measure the respondents' knowledge or other abilities
Arts and entertainment
* ''Test'' (2013 film), an American film
* ''Test'' (2014 film) ...
and
debug
In engineering, debugging is the process of finding the root cause, workarounds, and possible fixes for bugs.
For software, debugging tactics can involve interactive debugging, control flow analysis, log file analysis, monitoring at the ap ...
other programs (the "target" programs). Common features of debuggers include the ability to run or halt the target program using
breakpoint
In software development, a breakpoint is an intentional stopping or pausing place in a computer program, program, put in place for debugging purposes. It is also sometimes simply referred to as a pause.
More generally, a breakpoint is a means o ...
s,
step through code line by line, and display or modify the contents of memory, CPU registers, and stack frames.
The code to be examined might alternatively be running on an ''
instruction set simulator
An instruction set simulator (ISS) is a simulation model (abstract), model, usually coded in a high-level programming language, which mimics the behavior of a mainframe or microprocessor by "reading" instructions and maintaining internal variables ...
'' (ISS), a technique that allows great power in its ability to halt when specific conditions are encountered, but which will typically be somewhat slower than executing the code directly on the appropriate (or the same) processor. Some debuggers offer two modes of operation, full or partial simulation, to limit this impact.
An exception occurs when the program cannot normally continue because of a
programming bug or invalid data. For example, the program might have tried to use an instruction not available on the current version of the
CPU or attempted to access unavailable or
protected memory
Memory is the faculty of the mind by which data or information is encoded, stored, and retrieved when needed. It is the retention of information over time for the purpose of influencing future action. If past events could not be remembe ...
. When the program "traps" or reaches a preset condition, the debugger typically shows the location in the original code if it is a source-level debugger or symbolic debugger, commonly now seen in
integrated development environment
An integrated development environment (IDE) is a Application software, software application that provides comprehensive facilities for software development. An IDE normally consists of at least a source-code editor, build automation tools, an ...
s. If it is a low-level debugger or a machine-language debugger it shows the line in the
disassembly
A disassembler is a computer program that translates machine language into assembly language—the inverse operation to that of an assembler. The output of disassembly is typically formatted for human-readability rather than for input to an asse ...
(unless it also has online access to the original source code and can display the appropriate section of code from the assembly or compilation).
Features
Typically, debuggers offer a query processor, a symbol resolver, an expression interpreter, and a debug support interface at its top level. Debuggers also offer more sophisticated functions such as running a program step by step (single-stepping or
program animation
Program animation or stepping refers to the debugging method of executing Source code, code one instruction or line at a time. The programmer may examine the State (computer science), state of the program, machine, and related data before and after ...
), stopping (breaking) (pausing the program to examine the current state) at some event or specified instruction by means of a
breakpoint
In software development, a breakpoint is an intentional stopping or pausing place in a computer program, program, put in place for debugging purposes. It is also sometimes simply referred to as a pause.
More generally, a breakpoint is a means o ...
, and tracking the values of variables. Some debuggers have the ability to modify the program state while it is running. It may also be possible to continue execution at a different location in the program to bypass a crash or logical error.
The same functionality which makes a debugger useful for correcting bugs allows it to be used as a
software cracking
Software cracking (known as "breaking" mostly in the 1980s) is an act of removing copy protection from a software. Copy protection can be removed by applying a specific ''crack''. A ''crack'' can mean any tool that enables breaking software p ...
tool to evade
copy protection
Copy protection, also known as content protection, copy prevention and copy restriction, is any measure to enforce copyright by preventing the reproduction of software, films, music, and other media.
Copy protection is most commonly found on vid ...
,
digital rights management
Digital rights management (DRM) is the management of legal access to digital content. Various tools or technological protection measures, such as access control technologies, can restrict the use of proprietary hardware and copyrighted works. DRM ...
, and other software protection features. It often also makes it useful as a general verification tool,
fault coverage
Fault coverage refers to the percentage of some type of fault that can be detected during the test of any engineered system. High fault coverage is particularly valuable during manufacturing test, and techniques such as Design For Test (DFT) and ...
, and
performance analyser, especially if
instruction path length
In computer performance, the instruction path length is the number of machine code instructions required to execute a section of a computer program. The total path length for the entire program could be deemed a measure of the algorithm's perfor ...
s are shown. Early microcomputers with disk-based storage often benefitted from the ability to diagnose and recover corrupted directory or registry data records, to "undelete" files marked as deleted, or to crack file password protection.
Most mainstream debugging engines, such as
gdb and
dbx dbx or DBX may refer to:
* dbx (debugger), a Unix source-level debugger
* dbx (company), a professional audio recording equipment company
** dbx (noise reduction), a noise reduction system invented by dbx, Inc.
* .dbx, the file extension for Micros ...
, provide console-based
command line interface
A command-line interface (CLI) is a means of interacting with software via commands each formatted as a line of text. Command-line interfaces emerged in the mid-1960s, on computer terminals, as an interactive and more user-friendly alternati ...
s.
Debugger front-end
A debugger is a computer program used to software testing, test and debugging, debug other programs (the "target" programs). Common features of debuggers include the ability to run or halt the target program using breakpoints, stepping (debuggin ...
s are popular extensions to debugger engines that provide
IDE integration,
program animation
Program animation or stepping refers to the debugging method of executing Source code, code one instruction or line at a time. The programmer may examine the State (computer science), state of the program, machine, and related data before and after ...
, and visualization features.
Record and replay debugging
Record and replay debugging, also known as "software flight recording" or "program execution recording", captures application state changes and stores them to disk as each instruction in a program executes. The recording can then be replayed over and over, and interactively debugged to diagnose and resolve defects. Record and replay debugging is very useful for remote debugging and for resolving intermittent, non-deterministic, and other hard-to-reproduce defects.
Reverse debugging
Some debuggers include a feature called "reverse debugging", also known as "historical debugging" or "backwards debugging". These debuggers make it possible to step a program's execution backwards in time. Various debuggers include this feature.
Microsoft Visual Studio
Visual Studio is an integrated development environment (IDE) developed by Microsoft. It is used to develop computer programs including websites, web apps, web services and mobile apps. Visual Studio uses Microsoft software development platforms ...
(2010 Ultimate edition, 2012 Ultimate, 2013 Ultimate, and 2015 Enterprise edition) offers IntelliTrace reverse debugging for C#, Visual Basic .NET, and some other languages, but not C++. Reverse debuggers also exist for C, C++, Java, Python, Perl, and other languages. Some are open source; some are proprietary commercial software. Some reverse debuggers slow down the target by orders of magnitude, but the best reverse debuggers cause a slowdown of 2× or less. Reverse debugging is very useful for certain types of problems, but is still not commonly used yet.
Time travel debugging
In addition to the features of reverse debuggers,
time travel debugging also allow users to interact with the program, changing the history if desired, and watch how the program responds.
Language dependency
Some debuggers operate on a single specific language while others can handle multiple languages transparently. For example, if the main target program is written in
COBOL
COBOL (; an acronym for "common business-oriented language") is a compiled English-like computer programming language designed for business use. It is an imperative, procedural, and, since 2002, object-oriented language. COBOL is primarily ...
but calls
assembly language
In computing, assembly language (alternatively assembler language or symbolic machine code), often referred to simply as assembly and commonly abbreviated as ASM or asm, is any low-level programming language with a very strong correspondence bet ...
subroutines and
PL/1
PL/I (Programming Language One, pronounced and sometimes written PL/1) is a procedural, imperative computer programming language initially developed by IBM. It is designed for scientific, engineering, business and system programming. It has b ...
subroutines, the debugger may have to dynamically switch modes to accommodate the changes in language as they occur.
Memory protection
Some debuggers also incorporate memory protection to avoid
storage violations such as
buffer overflow. This may be extremely important in
transaction processing
In computer science, transaction processing is information processing that is divided into individual, indivisible operations called ''transactions''. Each transaction must succeed or fail as a complete unit; it can never be only partially c ...
environments where memory is dynamically allocated from memory 'pools' on a task by task basis.
Hardware support for debugging
Most modern microprocessors have at least one of these features in their
CPU design
Processor design is a subfield of computer science and computer engineering (fabrication) that deals with creating a processor (computing), processor, a key component of computer hardware.
The design process involves choosing an instruction set an ...
to make debugging easier:
*Hardware support for single-stepping a program, such as the
trap flag.
*An instruction set that meets the
Popek and Goldberg virtualization requirements
The Popek and Goldberg virtualization requirements are a set of conditions sufficient for a computer architecture to support system virtualization efficiently. They were introduced by Gerald J. Popek and Robert P. Goldberg in their 1974 article " ...
makes it easier to write debugger software that runs on the same CPU as the software being debugged; such a CPU can execute the inner loops of the program under test at full speed, and still remain under debugger control.
*
In-system programming allows an external hardware debugger to reprogram a system under test (for example, adding or removing instruction breakpoints). Many systems with such ISP support also have other hardware debug support.
*Hardware support for code and data
breakpoint
In software development, a breakpoint is an intentional stopping or pausing place in a computer program, program, put in place for debugging purposes. It is also sometimes simply referred to as a pause.
More generally, a breakpoint is a means o ...
s, such as address comparators and data value comparators or, with considerably more work involved,
page fault
In computing, a page fault is an exception that the memory management unit (MMU) raises when a process accesses a memory page without proper preparations. Accessing the page requires a mapping to be added to the process's virtual address space ...
hardware.
[Aggarwal and Kumar 2003, pp. 299-301.]
*
JTAG
JTAG (named after the Joint Test Action Group which codified it) is an industry standard for verifying designs of and testing printed circuit boards after manufacture.
JTAG implements standards for on-chip instrumentation in electronic design ...
access to hardware debug interfaces such as those on
ARM architecture
ARM (stylised in lowercase as arm, formerly an acronym for Advanced RISC Machines and originally Acorn RISC Machine) is a family of reduced instruction set computer, RISC instruction set architectures (ISAs) for central processing unit, com ...
processors or using the
Nexus command set. Processors used in embedded systems typically have extensive JTAG debug support.
*Micro controllers with as few as six pins need to use low pin-count substitutes for JTAG, such as
BDM,
Spy-Bi-Wire, or
debugWIRE on the
Atmel AVR
AVR is a family of microcontrollers developed since 1996 by Atmel, acquired by Microchip Technology in 2016. They are 8-bit RISC single-chip microcontrollers based on a modified Harvard architecture. AVR was one of the first microcontroller ...
. DebugWIRE, for example, uses bidirectional signaling on the RESET pin.
Debugger front-ends
Some of the most capable and popular debuggers implement only a simple command line interface (CLI)—often to maximize
portability and minimize resource consumption. Developers typically consider debugging via a
graphical user interface
A graphical user interface, or GUI, is a form of user interface that allows user (computing), users to human–computer interaction, interact with electronic devices through Graphics, graphical icon (computing), icons and visual indicators such ...
(GUI) easier and more productive. This is the reason for visual front-ends, that allow users to monitor and control subservient CLI-only debuggers via
graphical user interface
A graphical user interface, or GUI, is a form of user interface that allows user (computing), users to human–computer interaction, interact with electronic devices through Graphics, graphical icon (computing), icons and visual indicators such ...
. Some GUI debugger front-ends are designed to be compatible with a variety of CLI-only debuggers, while others are targeted at one specific debugger.
Ethical or legal debugging
Debugging is often used to illegally crack or pirate software, which is usually illegal even when done non-maliciously.
Crackme's are programs specifically designed to be cracked or debugged. These programs allow those with debuggers to practice their debugging ability without getting into legal trouble.
List of debuggers
Some widely used debuggers are:
*
Arm DTT, formerly known as Allinea DDT
*
Eclipse
An eclipse is an astronomical event which occurs when an astronomical object or spacecraft is temporarily obscured, by passing into the shadow of another body or by having another body pass between it and the viewer. This alignment of three ...
debugger API used in a range of IDEs: Eclipse IDE (Java), Nodeclipse (JavaScript)
*
Firefox
Mozilla Firefox, or simply Firefox, is a free and open-source web browser developed by the Mozilla Foundation and its subsidiary, the Mozilla Corporation. It uses the Gecko rendering engine to display web pages, which implements curr ...
JavaScript
JavaScript (), often abbreviated as JS, is a programming language and core technology of the World Wide Web, alongside HTML and CSS. Ninety-nine percent of websites use JavaScript on the client side for webpage behavior.
Web browsers have ...
debugger
*
GDB - the GNU debugger
*
LLDB
*
Microsoft Visual Studio Debugger
*
Radare2
Radare2 (also known as r2) is a complete framework for reverse-engineering and analyzing binaries; composed of a set of small utilities that can be used together or independently from the command line. Built around a disassembler for computer s ...
*
Valgrind
*
WinDbg
WinDbg is a multipurpose debugger for the Microsoft Windows computer operating system, distributed by Microsoft. It can be used to debug user mode applications, device drivers, and the operating system itself in kernel mode.
Overview
Like the ...
*
x64dbg/x32dbg
*
Cheat Engine
Earlier
minicomputer
A minicomputer, or colloquially mini, is a type of general-purpose computer mostly developed from the mid-1960s, built significantly smaller and sold at a much lower price than mainframe computers . By 21st century-standards however, a mini is ...
debuggers include:
*
Dynamic debugging technique (DDT)
*
On-line Debugging Tool (ODT)
Mainframe
A mainframe computer, informally called a mainframe or big iron, is a computer used primarily by large organizations for critical applications like bulk data processing for tasks such as censuses, industry and consumer statistics, enterpris ...
debuggers include:
*
CA/EZTEST
See also
*
References
Citations
Sources
*
*
External links
{{Wiktionary, debugger
Debugging Tools for WindowsOpenRCE: Various Debugger Resources and Plug-insIntelliTraceMSDN, Visual Studio 2015
Debugging
Utility software types