Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Debugger
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{short description|Computer program used to test and debug other programs}} {{Software development process|Tools}} [[File:Winpdb-1.3.6.png|thumb |[[Winpdb]] debugging itself]] 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 [[breakpoint]]s, [[stepping (debugging)|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]]'' (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 [[software bug|programming bug]] or invalid data. For example, the program might have tried to use an instruction not available on the current version of the [[central processing unit|CPU]] or attempted to access unavailable or [[memory protection|protected]] [[computer memory|memory]]. 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]]s. If it is a '''low-level debugger''' or a '''machine-language debugger''' it shows the line in the [[disassembly]] (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.<ref>Aggarwal and Kumar, p. 302.</ref> Debuggers also offer more sophisticated functions such as running a program step by step ('''single-stepping''' or [[program animation]]), stopping ('''breaking''') (pausing the program to examine the current state) at some event or specified instruction by means of a [[breakpoint]], and tracking the values of variables.<ref>Aggarwal and Kumar 2003, p. 301.</ref> 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]] tool to evade [[copy protection]], [[digital rights management]], and other software protection features. It often also makes it useful as a general verification tool, [[fault coverage]], and [[Profiling (computer programming)|performance analyser]], especially if [[instruction path length]]s are shown.<ref>Aggarwal and Kumar, pp. 307-312.</ref> 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 (debugger)|dbx]], provide console-based [[command line interface]]s. [[Debugger front-end]]s are popular extensions to debugger engines that provide [[Integrated Developer Environment|IDE]] integration, [[program animation]], and visualization features. === Record and replay debugging === [[Record and replay debugging]],<ref>{{cite arXiv |first1=Robert |last1=O'Callahan |first2=Chris |last2=Jones |first3=Nathan |last3=Froyd |first4=Kyle |last4=Huey |first5=Albert |last5=Noll |first6=Nimrod |last6=Partush |title=Engineering Record And Replay For Deployability Extended Technical Report |year=2017 |class=cs.PL |eprint=1705.05937 }}</ref> 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. ==={{anchor|Reverse debugging}}Reverse debugging=== <!-- At least six pages redirect to this section. Please do not remove the section or rename the anchor, without first getting consensus on the talk page. --> 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]] (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.<ref>{{cite web|author1=Philip Claßen|author2=Undo Software|title=Why is reverse debugging rarely used?|url=http://programmers.stackexchange.com/questions/181527/why-is-reverse-debugging-rarely-used|work=Programmers Stack Exchange|publisher=Stack Exchange, Inc|access-date=12 April 2015}}</ref> ==={{anchor|Time Travel debugging}}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]] but calls [[assembly language]] subroutines and [[PL/1]] 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 violation]]s such as [[buffer overflow]]. This may be extremely important in [[transaction processing]] 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]] 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]] 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]]s, such as address comparators and data value comparators or, with considerably more work involved, [[page fault]] hardware.<ref>Aggarwal and Kumar 2003, pp. 299-301.</ref> *[[JTAG]] access to hardware debug interfaces such as those on [[ARM architecture]] processors or using the [[Nexus (standard)|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 [[Background debug mode interface|BDM]], [[Spy-Bi-Wire]], or [[debugWIRE]] on the [[Atmel AVR]]. 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 [[porting|portability]] and minimize resource consumption. Developers typically consider debugging via a [[graphical user interface]] (GUI) easier and more productive.{{Citation needed|date=November 2019}} This is the reason for visual front-ends, that allow users to monitor and control subservient CLI-only debuggers via [[graphical user interface]]. 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|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== {{main|List of debuggers}} Some widely used debuggers are: *[[Allinea DDT|Arm DTT]], formerly known as Allinea DDT *[[Eclipse (software)|Eclipse]] debugger API used in a range of IDEs: Eclipse IDE (Java), Nodeclipse (JavaScript) *[[Firefox]] [[JavaScript]] debugger *[[GNU Debugger|GDB]] - the GNU debugger *[[LLDB (debugger)|LLDB]] *[[Microsoft Visual Studio Debugger]] *[[Radare2]] *[[Valgrind]] *[[WinDbg]] *[[x64dbg|x64dbg/x32dbg]] *[[Cheat Engine]] Earlier [[minicomputer]] debuggers include: *[[Dynamic debugging technique]] (DDT) *[[On-line Debugging Tool]] (ODT) [[Mainframe]] debuggers include: *[[CA/EZTEST]] ==See also== {{Portal|Computer programming}} <!-- Please keep entries in alphabetical order & add a short description [[WP:SEEALSO]] --> {{columns-list|colwidth=30em| *[[Comparison of debuggers]] *[[Core dump]] *[[Kernel debugger]] *[[List of tools for static code analysis]] *[[Memory debugger]] *[[Packet analyzer]] *[[Profiling (computer programming)|Profiling]] *[[Time travel debugging]] *[[GNU Debugger]] *[[Rubber duck debugging]]}} *<!-- please keep entries in alphabetical order --> {{Clear}} == References == === Citations === {{Reflist}} === Sources === {{refbegin}} * {{cite encyclopedia |author1=Sanjeev Kumar Aggarwal |author2=M. Sarath Kumar |title=Debuggers for Programming Languages |encyclopedia=The Compiler Design Handbook: Optimizations and Machine Code Generation |editor1=Y.N. Srikant |editor2=Priti Shankar |location=Boca Raton, Florida|publisher=[[CRC Press]]|isbn=978-0-8493-1240-3|year=2003|pages=295–327|ref=none }} * {{cite book |author1=Jonathan B. Rosenberg |title = How Debuggers Work: Algorithms, Data Structures, and Architecture |year=1996 |publisher=[[John Wiley & Sons]]|isbn=0-471-14966-7|url-access=registration |url = https://archive.org/details/howdebuggerswork00rose |ref=none }} {{refend}} ==External links== {{Wiktionary|debugger}} *[http://www.microsoft.com/whdc/devtools/debugging/ Debugging Tools for Windows] *[http://www.openrce.org OpenRCE: Various Debugger Resources and Plug-ins] *[https://msdn.microsoft.com/en-us/library/dd264915.aspx/ IntelliTrace] MSDN, Visual Studio 2015 [[Category:Debuggers| ]] [[Category:Debugging]] [[Category:Utility software types]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Anchor
(
edit
)
Template:Citation needed
(
edit
)
Template:Cite arXiv
(
edit
)
Template:Cite book
(
edit
)
Template:Cite encyclopedia
(
edit
)
Template:Cite web
(
edit
)
Template:Clear
(
edit
)
Template:Columns-list
(
edit
)
Template:Main
(
edit
)
Template:Portal
(
edit
)
Template:Refbegin
(
edit
)
Template:Refend
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Template:Sister project
(
edit
)
Template:Software development process
(
edit
)
Template:Wiktionary
(
edit
)