Run-Time Bug Fix for WDEB386 Version 4.0.4

The WDEB386 debugger supplied with the Windows 95 DDK has some problems, both when running Windows 95 and especially when running earlier Windows versions.

Problems

Supose the debugger is run from a DOS command prompt to start Windows 95 and is given its /h switch. Then when the Windows session is shut down, i.e., when Windows exits to DOS, the debugger falls over, executing essentially random code. This is unfortunate because it defeats a Windows 95 feature that programmers could otherwise use to shorten the cycle of writing and testing.

The debugger does not work properly when running earlier versions of Windows. Most noticeable is the inability to break into the debugger by using either Ctrl-C at the terminal or Ctrl-Alt-SysRq on the test machine’s keyboard. This is inconvenient for programmers who want to test that code written primarily for Windows 95 will work as expected when run under earlier Windows versions.

The debugger has some attractive features that do not rely for their existence on anything new to Windows 95 but which are nonetheless not available when the debugger runs earlier versions of Windows. Among these features is the support for debugging via screen-switching instead of through a serial port.

Remedy

All three of the problems sketched above are rectifiable from a small DOS program. The idea is to place a WDEB386.COM program in the same directory as the WDEB386.EXE program supplied with the Windows 95 DDK. Thereafter, when running the debugger from a DOS command line prompt before starting Windows, the WDEB386.COM will run first and fix some bugs in WDEB386.EXE at run-time. Running WDEB386.COM does not modify the WDEB386.EXE file on disk. It works by hooking int 21h and modifying the image in memory before and during execution.

Source code for this WDEB386.COM is all in assembly language, with comments to describe the bugs that are addressed, and what is to be done about them. Some of the headers are from the diskette included with DOS Internals (ISBN 0-201-60835-9), and therefore date from as early as 1991. The program itself was written in 1996. I do not recall updating it for later WDEB386 versions.

For distribution, the built program and its source code are compressed into a zip file: click here to download the bug fix program for the Windows 95 DDK version of WDEB386.