Advanced WDEB386 Features and TipsLast reviewed: July 22, 1997Article ID: Q74605 |
3.00 3.10
WINDOWS
kbtool
The information in this article applies to:
SUMMARYThis article explains some of the more advanced WDEB386 commands and features, including:
MORE INFORMATION
Breakpoint CommandsSyntax:
BP[n] <address> [<passcount>] ["<breakpoint cmds>"] BR[n] E|W|R|1|2|4 <address> [<passcount>] ["<breakpoint cmds>"]A breakpoint command is a string of debugger commands that are executed when a breakpoint is hit. Semicolons (;) separate commands from one another. All text is converted to uppercase except for text surrounded by single quotation marks ('). Two single quotation marks ('') or two double quotation marks ("") in a row act as an escape character and add one single quotation mark or one double quotation mark to the string. The maximum length of a breakpoint command is 80 characters. Both normal (set with BP) and 386 debug register (set with BR) breakpoints can have breakpoint commands. The commands BP[n] "<breakpoint command>" or BR[n] "<breakpoint command>", where n is the breakpoint number, can be used to add or to change commands corresponding to existing breakpoints. Other breakpoints or the last breakpoint encountered can be set, cleared, disabled, or enabled. If the breakpoint has no breakpoint command string, WDEB386 executes the default (ZD) command. (See below for information about the default command.) The conditional execution command (J) is very useful in breakpoint commands (see below).
Conditional Execution CommandSyntax:
J <expr> ["<command list>"]This command executes the command list if the expression evaluates to TRUE (nonzero); otherwise, it continues to the next command in the command line (not including the ones in the command list parameter). If the command list contains more than one command, it must be enclosed in single or double quotation marks. Use a semicolon (;) to separate commands. No quotation marks are required if the command list contains zero or one command. The conditional execution command can be used in breakpoint commands to halt execution when an expression becomes true or in the default command (see below). Any operator, number, or symbol value can be used in the conditional expression. The following are the most common relational operators used with this command:
> Greater than < Less than >= Greater than or equal to <= Less than or equal to == Equal to != Not equal && Logical AND || Logical ORThe BY, WO, DW, and POI operators are very useful with the J command because they allow access to bytes, words, or dwords of memory in conditional expressions, as follows:
BY 1-byte value from the address WO 2-byte value from the address DW 4-byte value from the address POI 4-byte 16:16 address from the addressDW can be used to get a 32-bit flat address in an expression--for example %(DW ESI). Always put a zero in front of a hexadecimal number that begins with a nonnumeric character. Doing so will prevent the debugger from treating the number as a symbol and searching all the loaded symbol files. For example, using 0f000 is faster than f000. In Windows version 3.0, the backslash (\) prefix in front of registers skips the symbol lookup and speeds up the expression evaluation; that is, \DS:\SI is faster than DS:SI if many symbols have been defined. In Windows version 3.1, even though the \ prefix is allowed, the \ is not required to speed up register evaluation because registers are evaluated first.
Default Command (Z)Syntax:
ZD Run the default command ZL List the default command ZS "<command list>" Set the default commandThe debugger's initial default command string is R (display registers). The debugger runs the default command string when:
Examples
|
Additional reference words: 3.00 3.10
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |