test subcommand
The test subcommand can be used in conjunction with the bt subcommand to break at a specified address when a condition becomes true.
Format
test cond
Parameters
| Item | Description |
|---|---|
| cond | Specifies the conditional expression that evaluates to a value of either true or false. |
The conditional test requires two operands and a single operator. Operands include symbols, hexadecimal values, and hexadecimal expressions. Comparison operators that are supported include: ==, !=, >=, <=, >, and <. Additionally, the bitwise operators ^ (exclusive OR), & (AND), and | (OR) are supported. When bitwise operators are used, any non-zero result is considered to be true.
The syntax for the test subcommand requires that the operands and operator be delimited by spaces. This is very important to remember if the left square bracket ( [ ) alias is used. For example, the subcommand test kernel_heap != 0 can be written as [ kernel_heap != 0 . However, this subcommand is not valid if kernel_heap, !=, and 0 were not preceded by and followed by spaces.
Other
[
Examples
The following is an example of how to use the [ alias for the test subcommand:
KDB(0)> bt open "[ @sysinfo >= 3d ]" //stop on open() if condition true
KDB(0)> e //exit debugger
...
Enter kdb [ @sysinfo >= 3d ]
KDB(1)> bt //display current active trace break points
0: .open+000000 (sid:00000000) trace {hit: 1} {script: [ @sysinfo >= 3d ]}
KDB(1)> dw sysinfo 1 //print sysinfo value
sysinfo+000000: 0000004A