Debug Monitor is a powerful graphical- and console-mode tool for monitoring all
activities handled by the WinDriver kernel (windrvr6.sys/.dll/.o/.ko).
You can use this tool to monitor how each command sent to the kernel is
executed.
In addition, WinDriver enables you to print your own debug messages to the
Debug Monitor, using the WD_DebugAdd() function
[B.6.6]
or the high-level PrintDbgMessage() function [B.7.14].
The Debug Monitor has two modes: graphical mode and console mode. The following sections explain how to operate Debug Monitor in both modes.
The graphical (GUI) version of the Debug Monitor utility - wddebug_gui - is available for Windows 98/Me/2000/XP/Server 2003/Vista and Linux. You may also use the Debug Monitor to debug your Windows CE driver code running on CE emulation on a Windows 2000/XP/Server 2003/Vista platform. For Windows CE targets, use Debug Monitor in console mode [7.2.2].
****************************************************************************************
| TIP | |
| Choose carefully those sections that you would like to monitor. Checking more options than necessary could result in an overflow of information, making it harder for you to locate your problem. |
This option enables you to send to an external kernel debugger all the debug information that is received from WinDriver's kernel module.
Now run your application, reproduce the problem, and view the debug information in the external kernel debugger's log.
Windows users can use Microsoft's WinDbg tool, for example, which is freely supplied with Microsoft's Driver Development Kit (DDK) and from Microsoft's web site (Microsoft Debugging Tools page).
By default, the graphical Debug Monitor program - wddebug_gui - logs messages from the windrvr6.sys/.o/.ko driver. However, you can also use wddebug_gui to log debug messages from a renamed driver (see explanation in section 12.2 regarding renaming the windrvr6 driver module) by running wddebug_gui from the command line with the driver_name option:
wddebug_gui <driver_name>
****************************************************************************************
| NOTE | |
| The driver name should be set to the name of the driver file without the file's extension; e.g. windrvr6, not windrvr6.sys (on Windows) or windrvr6.o (on Linux). |
For example, if you have renamed the default windrvr6.sys driver on Windows to my_driver.sys, you can log messages from your driver by running the Debug Monitor using the following command:
wddebug_gui my_driver
The Debug Monitor utility comes in a console-mode version - WinDriver/util/wddebug - which is available for all supported operating systems.
To use the wddebug console-mode version of the Debug Monitor utility on Windows 98/Me/2000/XP/Server 2003/Vista, Windows CE and Linux, run the WinDriver/util/wddebug utility, as explained below.
|
|
On Windows CE, start a Windows CE command window (CMD.EXE) on the Windows CE target and then run the program WDDEBUG.EXE inside this shell. |
WDDEBUG USAGE
wddebug [<driver_name>] <command> [<level>] [<sections>]
****************************************************************************************
| NOTE | |
| The wddebug command options must be used in the order in which they appear in the usage demonstration above. |
The driver name can be set either to windrvr6 (default), or to the name of any driver renamed from the windrvr6 driver module (see explanation in section 12.2).
****************************************************************************************
| NOTE | |
| The driver name should be set to the name of the driver file without the file's extension; e.g. windrvr6, not windrvr6.sys (on Windows) or windrvr6.o (on Linux). |
****************************************************************************************
| NOTE | |
| The on and dbg_on commands can be run together with the level and/or sections options described below. |
****************************************************************************************
| NOTE | |
| The following options are applicable only to the Debug Monitor on and dbg_on activation commands described above. |
USAGE SEQUENCE
To log messages using wddebug, use this sequence:
You can use the level and/or sections flags to set the debug level and/or sections for the log. If these options are not explicitly set, the default values will be used.
You can also log messages from a renamed WinDriver driver by preceding the command with the name of the driver (see the <driver_name> option above). The default monitored driver is windrvr6.
You can turn off the display of the debug messages at any time by pressing Esc in the command prompt.
|
|
You can also run wddebug with the status command while the Debug Monitor is turned off in order to view information regarding the running <driver_name> kernel module. |
EXAMPLE
The following is an example of a typical wddebug usage sequence. Since no <driver_name> is set, the commands are applied to the default driver - windrvr6.
Note: This is the same as running ''wddebug on TRACE'', since ALL is default debug sections option.