Debug (command)

Last updated

DEBUG.COM (MS-DOS <= 2.0), DEBUG.EXE (MS-DOS >= 3.x)
Original author(s) Tim Paterson
Developer(s) Microsoft, IBM, Digital Research, Novell, Caldera
Written in MS-DOS: x86 assembly language
Operating system DOS, OS/2, Windows
Type Debugger
License MS-DOS v2.0, FreeDOS: MIT
OS/2, Windows: Proprietary software
Website Debug

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 [1] ).

Contents

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.

Overview

DEBUG.COM (among other commands) in IBM PC DOS 1.0. IBM PC DOS 1.0 screenshot.png
DEBUG.COM (among other commands) in IBM PC DOS 1.0.
The Microsoft Windows 95 DEBUG.EXE command Microsoft Windows 95 Version 4.00.1111 debug command 492x259.png
The Microsoft Windows 95 DEBUG.EXE command

Traditionally, all computers and operating systems have included a maintenance function, used to determine whether a program is working correctly.[ citation needed ] 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, the executable was renamed into DEBUG.EXE with MS-DOS 3.2. [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. [3]

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, a reimplementation of Digital Research's former Symbolic Instruction Debugger SID/SID86, [4] which came with former versions of DR DOS. [5] [6] [7] 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 a commenting disassembler. [8] [7] Some versions also utilized DPMS to function as a "stealth mode" protected-mode debugger. [9]

The FreeDOS version of DEBUG was developed by Paul Vojta and is licensed under the MIT License. [10]

A 32-bit clone "DEBUGX" version supporting 32-bit DPMI programs exists as well. [11] 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. [12]

Syntax

DEBUG [[drive:][path] filename [parameters]]

When DEBUG 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. [13] DEBUG can also be used as a "DEBUG script" interpreter using the following syntax.

DEBUG < filename

A script file may contain DEBUG subcommands and assembly language instructions. [14] This method can be used to create or edit binary files from batch files. [2]

Using for non-debugging purposes

The DEBUG utility 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.

Availability

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. [15]

Other Operating Systems

The operating systems Intel ISIS-II [16] and iRMX 86, [17] DEC TOPS-10 [18] and TOPS-20, [19] THEOS/OASIS, [20] Zilog Z80-RIO, [21] Stratus OpenVOS, [22] PC-MOS, [23] and AROS [24] also provide a DEBUG command.

See also

Related Research Articles

<span class="mw-page-title-main">Drive letter assignment</span> Alphabetical assignment to logical drives on computers (e.g., C:\)

In computer data storage, drive letter assignment is the process of assigning alphabetical identifiers to volumes. Unlike the concept of UNIX mount points, where volumes are named and located arbitrarily in a single hierarchical namespace, drive letter assignment allows multiple highest-level namespaces. Drive letter assignment is thus a process of using letters to name the roots of the "forest" representing the file system; each volume holds an independent "tree".

<span class="mw-page-title-main">DR-DOS</span> MS-DOS-like operating system

DR-DOS is a disk operating system for IBM PC compatibles. Upon its introduction in 1988, it was the first DOS attempting to be compatible with IBM PC DOS and MS-DOS.

<span class="mw-page-title-main">COMMAND.COM</span> Default command line for MS-DOS and Windows 9x

COMMAND.COM is the default command-line interpreter for MS-DOS, Windows 95, Windows 98 and Windows Me. In the case of DOS, it is the default user interface as well. It has an additional role as the usual first program run after boot, hence being responsible for setting up the system by running the AUTOEXEC.BAT configuration file, and being the ancestor of all processes.

<span class="mw-page-title-main">Dynamic debugging technique</span> Series of debugger programs

Dynamic Debugging Technique (DDT) is a series of debugger programs originally developed for Digital Equipment Corporation (DEC) hardware, initially known as DEC Debugging Tape because it was distributed on paper tape. The name is a pun on the insecticide DDT. The first version of DDT was developed at MIT for the PDP-1 computer in 1961, but newer versions on newer platforms continued to use the same name. After being ported to other vendor's platforms and changing media, the name was changed to the less DEC-centric version. Early versions of Digital Research's CP/M and CP/M-86 kept the DEC name DDT for their debugger, however, now meaning Dynamic Debugging Tool. The CP/M DDT was later superseded by the Symbolic Instruction Debugger in DR DOS and GEM.

<span class="mw-page-title-main">4DOS</span> Command line interpreter

4DOS is a command-line interpreter by JP Software, designed to replace the default command interpreter COMMAND.COM in Microsoft DOS and Windows. It was written by Rex C. Conn and Tom Rawson and first released in 1989. Compared to the default, it has a large number of enhancements.

An environment variable is a user-definable value that can affect the way running processes will behave on a computer. Environment variables are part of the environment in which a process runs. For example, a running process can query the value of the TEMP environment variable to discover a suitable location to store temporary files, or the HOME or USERPROFILE variable to find the directory structure owned by the user running the process.

<span class="mw-page-title-main">High memory area</span>

In DOS memory management, the high memory area (HMA) is the RAM area consisting of the first 65520 bytes above the one megabyte in an IBM AT or compatible computer.

CodeView is a standalone debugger created by David Norris at Microsoft in 1985 as part of its development toolset. It originally shipped with Microsoft C 4.0 and later. It also shipped with Visual Basic for MS-DOS, Microsoft BASIC PDS, and a number of other Microsoft language products. It was one of the first debuggers for MS-DOS to be full-screen oriented, rather than line-oriented.

CONFIG.SYS is the primary configuration file for the DOS and OS/2 operating systems. It is a special ASCII text file that contains user-accessible setup or configuration directives evaluated by the operating system's DOS BIOS during boot. CONFIG.SYS was introduced with DOS 2.0.

<span class="mw-page-title-main">DOSKEY</span>

DOSKEY is a command for DOS, IBM OS/2, Microsoft Windows, and ReactOS that adds command history, macro functionality, and improved editing features to the command-line interpreters COMMAND.COM and cmd.exe.

<span class="mw-page-title-main">ViewMAX</span> File manager

ViewMAX is a CUA-compliant file manager supplied with DR DOS versions 5.0 and 6.0. It is based on a cut-down runtime version of Digital Research's GEM/3 graphical user interface modified to run only a single statically built application, the ViewMAX desktop. Support for some unneeded functions has been removed whilst some new functions were added at the same time. Nevertheless, the systems remained close enough for ViewMAX to recognize GEM desktop accessories automatically and to allow some native GEM applications to be run inside the ViewMAX environment. Many display drivers for GEM 3.xx could be used by ViewMAX as well, enabling ViewMAX to be used with non-standard display adapters and higher resolutions than possible using the default set of ViewMAX drivers. Also, Digital Research's SID86, the symbolic instruction debugger that shipped with DR DOS 3.xx and provided dedicated functions to debug GEM applications, could be used for ViewMAX as well.

Virtual DOS machines (VDM) refer to a technology that allows running 16-bit/32-bit DOS and 16-bit Windows programs when there is already another operating system running and controlling the hardware.

Computer hardware or software is said to be bug compatible if it exactly replicates even an undesirable feature of a previous version. The phrase is found in the Jargon File.

<span class="mw-page-title-main">MSCDEX</span>

MSCDEX or Microsoft CD-ROM Extensions is a software program produced by Microsoft and included with MS-DOS 6.x and certain versions of Windows to provide CD-ROM support. Earlier versions of MSCDEX since 1986 were installable add-ons for MS-DOS 3.1 and higher.

<span class="mw-page-title-main">TYPE (DOS command)</span>

In computing, type is a command in various command-line interpreters (shells) such as COMMAND.COM, cmd.exe, 4DOS/4NT and Windows PowerShell used to display the contents of specified files on the computer terminal. The analogous Unix command is cat.

In computing, LOADHIGH is an internal DOS command in COMMAND.COM that is used to load a program into the upper memory area (UMA) instead of conventional memory.

<span class="mw-page-title-main">MS-DOS</span> Microsofts discontinued operating system

MS-DOS is an operating system for x86-based personal computers mostly developed by Microsoft. Collectively, MS-DOS, its rebranding as IBM PC DOS, and a few operating systems attempting to be compatible with MS-DOS, are sometimes referred to as "DOS". MS-DOS was the main operating system for IBM PC compatibles during the 1980s, from which point it was gradually superseded by operating systems offering a graphical user interface (GUI), in various generations of the graphical Microsoft Windows operating system.

<span class="mw-page-title-main">Command-line interface</span> Computer interface that uses text

A command-line interface (CLI) is a means of interacting with a computer program by inputting lines of text called command-lines. Command-line interfaces emerged in the mid-1960s, on computer terminals, as a user-friendly alternative to punched cards.

DOS Protected Mode Services (DPMS) is a set of extended DOS memory management services to allow DPMS-enabled DOS drivers to load and execute in extended memory and protected mode.

References

  1. According to Microsoft Macro Assembler Reference, inline assembly is not supported for x64.
  2. 1 2 Sedory, Daniel B. "A Guide to DEBUG" . Retrieved 2014-11-29.
  3. MS-DOS subsystem commands
  4. SID-86 User's Guide for CP/M-86 (2 ed.). Digital Research. August 1982 [March 1982]. SID86UG.WS4. Archived from the original on 2019-10-20. Retrieved 2020-02-06. (NB. A retyped version of the manual by Emmanuel Roche with Q, SR, and Z commands added. This manual is for the CP/M-86 version, but the DR DOS version is similar.)
  5. Born, Günter [in German] (1993). DOS 6 Tuning (in German) (1 ed.). Markt & Technik. ISBN   3-87791-495-0. (NB. Has several pages on MS-DOS DEBUG.EXE as well as on the Symbolic Instruction Debugger SID.EXE in DR DOS 5.0/6.0.)
  6. Paul, Matthias R. (1997-05-24) [1991]. DRDOSTIP.TXT — Tips und Tricks für DR DOS 3.41 - 5.0. Archived from the original on 2016-11-07. Retrieved 2016-11-07.{{cite book}}: |work= ignored (help) (NB. Has some information on Symbolic Instruction Debugger (SID86.EXE in DR DOS 3.41 and SID.EXE in DR DOS 5.0/6.0), the predecessor of the DR-DOS DEBUG.EXE.)
  7. 1 2 Paul, Matthias R. (2002-01-09). "SID86". Newsgroup:  comp.os.cpm . Retrieved 2018-04-08. […] Since the DR-DOS 7.03 DEBUG is still based on the old SID86.EXE, I suggest to run DEBUG 1.51 and enter the extended help system with ?? from the debug prompt. This will give you eight screens full of syntax and feature help. Some of these features were also supported by older issues. […]
  8. Paul, Matthias R. (1997-07-30). "Kapitel II.5. Allgemeines: Undokumentierte Möglichkeiten von DEBUG" [Undocumented features of DEBUG]. NWDOS-TIPs Tips & Tricks rund um Novell DOS 7, mit Blick auf undokumentierte Details, Bugs und Workarounds. Archived from the original on 2017-09-10. Retrieved 2014-09-06.{{cite book}}: |work= ignored (help) (NB. NWDOSTIP.TXT is a comprehensive work on Novell DOS 7 and OpenDOS 7.01, including the description of many undocumented features and internals. It is part of the author's yet larger MPDOSTIP.ZIP collection maintained up to 2001 and distributed on many sites at the time. The provided link points to a HTML-converted older version of the NWDOSTIP.TXT file.)
  9. Paul, Matthias R. (2001-04-09). NWDOS-TIPs Tips & Tricks rund um Novell DOS 7, mit Blick auf undokumentierte Details, Bugs und Workarounds.{{cite book}}: |work= ignored (help)
  10. "FreeDOS 1.2 Updates Package - debug (FreeDOS Base)". Ibiblio.org. 2021-02-16. Retrieved 2022-09-08.
  11. Vojta, Paul. "DEBUG README". Archived from the original on 2007-08-24. Retrieved 2007-06-25.
  12. Brooks, Vernon C. (2014-04-08). "Enhanced DEBUG for PC DOS and MS-DOS". PC DOS Retro. Archived from the original on 2020-02-21. Retrieved 2014-05-08.
  13. "Microsoft TechNet Debug article" . Retrieved 2008-04-23.
  14. Irvine, Kip R. (2010). "Using Debug". Assembly language for Intel-based computers (PDF) (6th ed.). Prentice Hall. ISBN   978-0-13602212-1 . Retrieved 2014-03-18.
  15. Dror, Asael (1988-01-12). "Thank You, IBM". PC Magazine . p. 366.
  16. ISIS II Users Guide
  17. iRMX 86 Introduction And Operator's Reference Manual For Release 6
  18. TOPS-10 Operating System Commands Manual (PDF). Digital Equipment Corporation. August 1980. Archived from the original (PDF) on 2020-08-09. Retrieved 2019-02-17.
  19. "TOPS-20 Command manual" (PDF). Archived from the original (PDF) on 2020-08-09. Retrieved 2018-07-18.
  20. THEOS/OASIS User′s Handbook
  21. Z80-RIO Operating System User's Manual
  22. "OpenVOS Commands Reference Manual" (PDF).
  23. PC-MOS User Guide
  24. "AROS Research Operating System".