Misplaced Pages

Debug (command)

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.

A debugger or debugging tool is a computer program used to test and debug other programs (the "target" program). The main use of a debugger is to run the target program under controlled conditions that permit the programmer to track its execution and monitor changes in computer resources that may indicate malfunctioning code. Typical debugging facilities include the ability to run or halt the target program at specific points, display the contents of memory, CPU registers or storage devices (such as disk drives), and modify memory or register contents in order to enter selected test data that might be a cause of faulty program execution.

#779220

23-605: The line-oriented debugger DEBUG.EXE is an external command in operating systems such as DOS , OS/2 and Windows (only in 16-bit/32-bit versions). DEBUG can act as an assembler , disassembler , or hex dump program allowing users to interactively examine memory contents (in assembly language , hexadecimal or ASCII ), make changes, and selectively execute COM , EXE and other file types. It also has several subcommands which are used to access specific disk sectors , I/O ports and memory addresses . Traditionally, all computers and operating systems have included

46-481: A DEBUG command. Debugger 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. A " trap " occurs when

69-623: A commenting disassembler . Some versions also utilized DPMS to function as a "stealth mode" protected-mode debugger. The FreeDOS version of DEBUG was developed by Paul Vojta and is licensed under the MIT License . A 32-bit clone "DEBUGX" version supporting 32-bit DPMI programs exists as well. Andreas "Japheth" Grech, the author of the HX DOS extender , developed enhanced DEBUG versions 0.98 to 1.25, and former PC DOS developer Vernon C. Brooks added versions 1.26 to 1.32. When DEBUG

92-514: A COM file. exe2bin could also be used to convert compiled code to make it suitable to be embedded in ROM as part of BIOS or a device driver . The command was included in MS-DOS versions 1 thru 3.1 as part of a standard distribution. For version 3.2, among the changes were the version included did not permit itself to run on any version except 3.2. For the next version, 3.3, there was no EXE2BIN on

115-463: A maintenance function, used to determine whether a program is working correctly. DEBUG was originally written by Tim Paterson to serve this purpose in 86-DOS . When Paterson began working for Microsoft in the early 1980s he brought the program with him. DEBUG was part of DOS 1.00 and has been included in MS-DOS / PC DOS and certain versions of Microsoft Windows . Originally named DEBUG.COM ,

138-401: 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. 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

161-450: 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. Some debuggers include a feature called " reverse debugging ", also known as "historical debugging" or "backwards debugging". These debuggers make it possible to step

184-472: 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

207-698: A reimplementation of Digital Research 's former Symbolic Instruction Debugger SID/SID86, which came with former versions of DR DOS . It is fully compatible with the DEBUG command line syntax of MS-DOS/PC DOS, but offers many enhancements, including supporting 16-bit and 32-bit opcodes up to the Pentium , an extended mode (/X) with dozens of additional commands and sub-modes, a much enhanced command line syntax with user-definable macros and symbolic debugging facilities with named registers, loaded symbol tables , mathematical operations and base conversions , as well as

230-562: 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. Some debuggers also incorporate memory protection to avoid storage violations such as buffer overflow . This may be extremely important in transaction processing environments where memory

253-451: 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). 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

SECTION 10

#1732797587780

276-440: Is a post-compilation utility program available on MS-DOS and other operating systems . Early compilers and linkers for the MS-DOS platform could not produce a COM file executable directly. Instead, the compilers would output an EXE-format file with relocation information. If all 8086 segments were set to be identical in such an EXE file (i.e. the "tiny" memory model was used), then exe2bin could convert it to

299-465: Is dynamically allocated from memory 'pools' on a task by task basis. Most modern microprocessors have at least one of these features in their CPU design to make debugging easier: 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 (GUI) easier and more productive. This

322-550: Is started without any parameters the DEBUG prompt, a "-" appears. The user can then enter one of several one or two-letter subcommands, including "A" to enter the assembler mode, "D" to perform a hexadecimal dump , "T" to trace and "U" to unassemble (disassemble) a program in memory. DEBUG can also be used as a "DEBUG script" interpreter using the following syntax. A script file may contain DEBUG subcommands and assembly language instructions. This method can be used to create or edit binary files from batch files . The DEBUG utility

345-791: 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. 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. Some widely used debuggers are: Earlier minicomputer debuggers include: Mainframe debuggers include: EXE2BIN (DOS command)#Availability The command-line tool exe2bin

368-570: Is useful for editing binary files in an environment where only DOS is installed without anything else. It can also be used to edit disk sectors, which is one method of removing boot-sector viruses. Although technical documentation for the DEBUG command was removed with the release of MS-DOS 3.3, the command was retained in the standard distribution, unlike what was done with EXE2BIN . The operating systems Intel ISIS-II and iRMX 86 , DEC TOPS-10 and TOPS-20 , THEOS/OASIS , Zilog Z80-RIO , Stratus OpenVOS , PC-MOS , and AROS also provide

391-614: The 1980s, and included with certain versions of IBM PC DOS . PhysTechSoft & Paragon Technology Systems PTS-DOS , Digital Research DR DOS 6.0 , and Datalight ROM-DOS , also include an implementation of the exe2bin command. The command is also available in FreeDOS . This implementation is licensed under the Sybase Open Watcom Public License . Windows XP and later versions include exe2bin and other 16-bit commands (nonnative) for

414-651: The DOS disk. "Instead, IBM sells the program separately, at an extra cost, with the DOS Technical Reference." IBM also added code to check the version. PC Magazine published a workaround: just patch it to work with 3.2 or higher. One way or the other, it was no longer available for the base price after 3.2; for version 6 it was on what was called the Supplemental Disk. The program was also distributed with many language compilers for MS-DOS in

437-607: 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 , provide console-based command line interfaces . Debugger front-ends are popular extensions to debugger engines that provide IDE integration, program animation , and visualization features. 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

460-481: The executable was renamed into DEBUG.EXE with MS-DOS 3.2. Windows XP and later versions included DEBUG for the MS-DOS subsystem to maintain MS-DOS compatibility. The 16-bit DOS commands are not available on 64-bit editions of Windows. The MS-DOS/PC DOS DEBUG has several limitations: Enhanced DEBUG packages include the DEBUG command in Novell DOS 7 , OpenDOS 7.01 and DR-DOS 7.02 and higher,

483-550: 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 . 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 environments . If it

SECTION 20

#1732797587780

506-498: 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 performance analyzer , especially if instruction path lengths are shown. Early microcomputers with disk-based storage often benefitted from

529-418: 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. 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. Some debuggers operate on

#779220