Redirecting Debugging Information Under Windows 3.0, 3.1Last reviewed: February 15, 1996Article ID: Q86263 |
The information in this article applies to:
SUMMARYEach new application for the Microsoft Windows environment should be tested under the Windows debugging kernel. When an application performs an illegal or potentially harmful operation, the debugging kernel traps the error and provides a descriptive message about the source of the problem. By default, the debugging kernel sends its messages to the AUX device (which maps to the COM1 port). This article describes how to redirect output from the debugging kernel under Windows versions 3.0 and 3.1.
MORE INFORMATIONAs noted above, in the Windows 3.0 and 3.1 environments, the debugging kernel sends its data to the AUX device, which (in general) maps to the COM1 port. One method to display this debugging information is to connect a serial communications terminal or another computer running a terminal emulation program to the COM1 port. Before running Windows, set the port's parameters appropriately through the MS-DOS MODE command. Placing the MODE command in the AUTOEXEC.BAT file automatically sets the port's parameters. When the debugging kernel starts, if no device is connected to COM1, the kernel displays a "Cannot write to device AUX" message box. If the COM1 port is dedicated to another use and cannot be connected to a serial terminal, you can configure the debug kernel to send its messages elsewhere. The remainder of this article explains the procedures required. Moreover, if you do not have a serial terminal connected to the COM1 port, then before starting the debug version of Windows, ensure that the following lines are added to the [Windows] section of the WIN.INI file:
DebugOptions=0x0000 DebugFilter=0x0000 DebugTaskFilter= ;leave it blankand the following new section to your SYSTEM.INI file:
[Debug] OutputTo=NULThe setting for the OutputTo entry in the SYSTEM.INI disables the default debug Kernel output to the AUX device (which maps to COM1 port). It is a good idea to do this, since DBWIN Windows sample application can be used to redirect output to either COM1 or COM2 port. The setting for the DebugOptions entry corresponds to the values for the dwOptions member of the WINDEBUGINFO structure in the Windows SDK. The setting for the DebugFilter entry corresponds to the values for the dwFilter member of WINDEBUGINFO. To determine the proper hexadecimal value for a setting, add the values of the options to be set. For example, to specify DBO_CHECKHEAP and DBO_FREEFILL, the setting for the DebugOptions entry would be 0x0021 (0x0001 + 0x0020). For information about the possible values for these options and a full description of the WINDEBUGINFO structure, see the Microsoft Windows Programmers Reference, Volume 3.
Windows 3.1In the Windows 3.1 environment, the debugging terminal is not required. The Windows 3.1 debugging kernel provides two methods to redirect debugging information:
Windows 3.0Windows 3.0 does not provide a built-in method to redirect debugging output; external measures are required. This article outlines two methods to redirect output under Windows 3.0. The first is through the WINAUX.SYS device driver that redirects debugging output into a window on the main display, similar to the DBWIN application discussed above. The second is through the OX.SYS device driver that redirects debugging output to a secondary monochrome adapter connected to the system. The WINAUX.SYS device driver is the method of choice. Download WINAUX.EXE, a self-extracting file, from the Microsoft Software Library (MSL) on the following services:
DEVICE=WINAUX.SYSAnother method to redirect debugging output under Windows 3.0 is to use the OX.SYS device driver that redirects output for the AUX device to a monochrome video adapter. Many development systems have a secondary monochrome display to use with CodeView for Windows (CVW). OX.SYS sends the debug messages to the monochrome display. The OX.SYS file and its source code is available in the Software Library. If necessary, you can modify the OX source code to direct debugging output to another device such as LPT1, COM2, and so on. Download OX.EXE, a self-extracting file, from the Microsoft Software Library (MSL) on the following services:
DEVICE=OX.SYSUnder Windows 3.0, OX.SYS is limited because it provides an input-only or output-only device. Therefore, when the Windows debugging kernel provides output for a FatalExit message followed by the "Abort, Break, Ignore?" prompt, OX.SYS cannot obtain the user's response. Third-party developers have developed bi-directional device drivers to address this limitation and have placed the drivers into the public domain. Two examples are WINRIP.SYS and MONO-DRV.SYS.
|
Additional reference words: 3.00 3.10 softlib OX.EXE WINAUX.EXE
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |