Next: , Up: Kernel Debugger

11.1 Operation

The current location is called dot. The dot is displayed with a hexadecimal format at a prompt. Examine and write commands update dot to the address of the last line examined or the last location modified, and set next to the address of the next location to be examined or changed. Other commands don't change dot, and set next to be the same as dot.

The general command syntax is:

     command[/modifier] address [,count]

!! repeats the previous command, and a blank line repeats from the address next with count 1 and no modifiers. Specifying address sets dot to the address. Omitting address uses dot. A missing count is taken to be 1 for printing commands or infinity for stack traces.

Current ddb is enhanced to support multi-thread debugging. A break point can be set only for a specific thread, and the address space or registers of non current thread can be examined or modified if supported by machine dependent routines. For example,

     break/t mach_msg_trap $task11.0

sets a break point at mach_msg_trap for the first thread of task 11 listed by a show all threads command.

In the above example, $task11.0 is translated to the corresponding thread structure's address by variable translation mechanism described later. If a default target thread is set in a variable $thread, the $task11.0 can be omitted. In general, if t is specified in a modifier of a command line, a specified thread or a default target thread is used as a target thread instead of the current one. The t modifier in a command line is not valid in evaluating expressions in a command line. If you want to get a value indirectly from a specific thread's address space or access to its registers within an expression, you have to specify a default target thread in advance, and to use :t modifier immediately after the indirect access or the register reference like as follows:

     set $thread $task11.0
     print $eax:t *(0x100):tuh

No sign extension and indirection size(long, half word, byte) can be specified with u, l, h and b respectively for the indirect access.

Note: Support of non current space/register access and user space break point depend on the machines. If not supported, attempts of such operation may provide incorrect information or may cause strange behavior. Even if supported, the user space access is limited to the pages resident in the main memory at that time. If a target page is not in the main memory, an error will be reported.

ddb has a feature like a command more for the output. If an output line exceeds the number set in the $lines variable, it displays ‘--db_more--’ and waits for a response. The valid responses for it are:

one more page
one more line
abort the current command, and return to the command input mode