|
|||
Dcmd and Walker Name Resolution 4. Using MDB Commands Interactively 9. Debugging With the Kernel Memory Allocator |
Formatting DcmdsThe /, \, ?, and = metacharacters are used to denote the special output formatting dcmds. Each of these dcmds accepts an argument list consisting of one or more format characters, repeat counts, or quoted strings. A format character is one of the ASCII characters described below. Format characters are used to read and format data from the target. A repeat count is a positive integer preceding the format character that is always interpreted in base 10 (decimal). A repeat count can also be specified as an expression enclosed in square brackets preceded by a dollar sign ($[ ]). A string argument must be enclosed in double quotation marks (" "). No blanks are necessary between format arguments. The formatting dcmds are:
In addition to dot, MDB keeps track of another global value called the increment. The increment represents the distance between dot and the address following all the data read by the last formatting dcmd. For example, let dot equal address addr, where addr displays as a 4-byte integer. After a formatting dcmd is executed with dot equal to addr, the increment is set to 4. The plus (+) operator, described in Arithmetic Expansion, would now evaluate to the value A+4, and could be used to reset dot to the address of the next data object for a subsequent dcmd. Most format characters increase the value of the increment by the number of bytes corresponding to the size of the data format. The number of bytes in various data formats are shown below. Use the ::formats dcmd to display the list of format characters from within MDB. The format characters are:
You can also use the /, \, and ? formatting dcmds to write to the target's virtual address space, physical address space, or object file. First specify one of the following modifiers as the first format character, and then specify a list of words. The words in the list are either immediate values or expressions enclosed in square brackets preceded by a dollar sign ($[ ]). The write modifiers are:
You can also use the /, \, and ? formatting dcmds to search for a particular integer value in the target's virtual address space, physical address space, and object file, respectively. First specify one of the following modifiers as the first format character, and then specify a value and optional mask. The value and mask are each either immediate values or expressions enclosed in square brackets preceded by a dollar sign. If only a value is specified, MDB reads integers of the appropriate size and stops at the address that contains the matching value. If a value V and mask M are specified, MDB reads integers of the appropriate size and stops at the address that contains a value X where (X & M) == V. At the completion of the dcmd, dot is updated to the address of the match. If no match is found, dot is left at the last address that was read. The search modifiers are:
For both user and kernel targets, an address space is typically composed of a set of discontiguous segments. It is not legal to read from an address that does not have a corresponding segment. If a search reaches a segment boundary without finding a match, the search aborts when the read past the end of the segment boundary fails. |
||
|