Debug (command)
![]() | |
Original author(s) | Tim Paterson |
---|---|
Developer(s) | Microsoft, IBM, Paul Vojta |
Operating system | DOS, MS-DOS, OS/2, Windows |
Type | Debugger |
License | MS-DOS, FreeDOS: MIT 86-DOS, OS/2, Windows: Proprietary commercial software |
Website | Debug |
debug
is a command in operating systems such as DOS, OS/2 and Microsoft Windows (only in 32bit[1]) which runs the program debug.exe (or DEBUG.COM in DOS version 4.x and older).[2]
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
Traditionally, all computers and operating systems have included a maintenance function, used to determine whether a program is working correctly.[citation needed] Debug was written by Tim Paterson to serve this purpose in QDOS. 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 and certain versions of Microsoft Windows. DOS debug has several limitations:
- It can only access 16-bit registers and not 32-bit extended registers.
- When the "n" subcommand for naming files is used, the filename is stored from offset DS:5D to DS:67 (the Program Segment Prefix File Control Block area), meaning that the program can only save files in FAT 8.3 filename format.
Windows XP and later versions include debug
and other 16-bit commands (nonnative) for the MS-DOS subsystem to maintain MS-DOS compatibility. The 16-bit MS-DOS subsystem commands are not available on 64-bit editions of Windows.[3]
Enhanced DEBUG package includes a 32-bit clone "DEBUGX" version supporting 32-bit DPMI programs as well.[4] Andreas "Japheth" Grech, the author of the HX DOS extender, developed enhanced DEBUG versions 0.98…1.25, and former PC DOS developer Vernon Brooks added versions 1.26…1.32.[5]
The operating systems Intel ISIS-II[6] and iRMX 86,[7] DEC TOPS-10[8] and TOPS-20[9], THEOS/OASIS,[10] Zilog Z80-RIO,[11] Stratus OpenVOS,[12] PC-MOS,[13] and AROS[14] also provide a debug
command. The FreeDOS version was developed by Paul Vojta.[15]
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.[16] 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.[17] This method can be used to create or edit binary files from batch files.[2]
Using for non-debugging purposes
The Debug utility was useful for editing binary files in an environment where only MS-DOS is installed without anything else. It can also be used to edit disk sectors, which was one method of removing boot-sector viruses in the MS-DOS era.
See also
References
- ^ According to Microsoft Macro Assembler Reference, inline assembly is not supported for x64.
- ^ a b Daniel B. Sedory. "A Guide to DEBUG". Retrieved 2014-11-29.
{{cite web}}
: Cite has empty unknown parameter:|1=
(help) - ^ MS-DOS subsystem commands
- ^ Paul Vojta. "DEBUG README". Archived from the original on 2007-08-24. Retrieved 2007-06-25.
- ^ Vernon Brooks (2014-04-08). "Enhanced DEBUG for PC DOS and MS-DOS". PC DOS Retro. Retrieved 2014-05-08.
- ^ ISIS II Users Guide
- ^ iRMX™86 INTRODUCTION AND OPERATOR'S REFERENCE MANUAL For Release 6
- ^ TOPS-10 Operating System Commands Manual (pdf). Digital Equipment Corporation. August 1980. Retrieved 2019-02-17.
- ^ "TOPS-20 Command manual" (PDF).
- ^ THEOS/OASIS User′s Handbook
- ^ Z80-RIO OPERATING SYSTEM USER'S MANUAL
- ^ http://stratadoc.stratus.com/vos/19.1.0/r098-19/wwhelp/wwhimpl/common/html/r098-19.pdf
- ^ PC-MOS User Guide
- ^ http://aros.sourceforge.net/documentation/users/shell/index.php
- ^ http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.2/repos/pkg-html/debug.html
- ^ "Microsoft TechNet Debug article". Retrieved 2008-04-23.
- ^ Kip R. Irvine (2010). "Using Debug". Assembly language for Intel-based computers (PDF) (6th ed.). Prentice Hall. ISBN 978-0136022121. Retrieved 2014-03-18.
Further reading
- 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.)
- Paul, Matthias R. (1997-05-24) [1991]. DRDOSTIP.TXT — Tips und Tricks für DR DOS 3.41 - 5.0 (in German) (47 ed.). 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.) - 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. Release 157 (in German) (3 ed.). 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.) - 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. […]
{{cite newsgroup}}
: CS1 maint: url-status (link)