wr, ww, wrw, cw, lwr, lww, lwrw, and lcw subcommands

The wr subcommand stops on a load instruction. The ww subcommand stops on a store instruction. The wrw subcommand stops either on a load or a store instruction. The cw subcommand clears the last watch subcommand. The lwr, lww, lwrw, and lcw subcommands allow you to establish a watchpoint for a specific processor.

Note: These subcommands are only available within the KDB kernel debugger. They are not included in the kdb command.

Format

wr [[-e | -p | -v] address [size]]

ww [[-e | -p | -v] address [size]]

wrw[[-e | -p | -v] address [size]]

cw

lwr[[-e | -p | -v] address [size]]

lww [[-e | -p | -v] address [size]]

lwrw [[-e | -p | -v] address [size]]

lcw

Parameters

Item Description
-e Indicates that the address parameter is an effective or virtual address.
-p Indicates that the address parameter is a physical or real address.
-v Indicates that the address parameter is a virtual or effective address.
address Specifies the address to watch. Symbols, hexadecimal values, or hexadecimal expressions can be used to specify the address. If the address type is not specified, it is assumed to be an effective address.
size Indicates the number of bytes to watch. This parameter is a decimal value.

A watch register can be used on the Data Address Breakpoint Register (DABR) or HID5 on PowerPC® 601 RISC Microprocessor to enter KDB kernel debugger when a specified effective address is accessed. The register holds a double-word effective address and bits to specify load and store operations.

With no parameter, the wr, ww and wrw subcommands print the current active watch subcommand.

The wr, ww, wrw and cw subcommands are global to all processors. The lwr, lww, lwrw and lcw subcommands are local. If no size is specified, the default size is 8 bytes and the address is double-word aligned. If a size is specified, KDB kernel debugger checks the faulting address with the specified range. If no match is found, KDB kernel debugger continues to run.

Other

wrstop-r

wwstop-w

wrwstop-rw

cwstop-cl

lwrlstop-r

lwwlstop-w

lwrwlstop-rw

lcwlstop-cl

Examples

The following is an example of how to use the ww, the wr and the cw subcommands:

   KDB(0)> ww -p emulate_count  //set a data break point (physical address, write mode)
   KDB(0)> ww  //print current data break points
   CPU 0: emulate_count+000000 paddr=00238360 size=8 hit=0 mode=W
   CPU 1: emulate_count+000000 paddr=00238360 size=8 hit=0 mode=W
   KDB(0)> e  //exit the debugger
   ...
   Watch trap: 00238360 <emulate_count+000000>
   power_asm_emulate+00013C     stw    r28,0(r30)          r28=0000003A,0(r30)=emulate_count
   KDB(0)> ww  //print current data break points
   CPU 0: emulate_count+000000 paddr=00238360 size=8 hit=1 mode=W
   CPU 1: emulate_count+000000 paddr=00238360 size=8 hit=0 mode=W
   KDB(0)> wr sysinfo  //set a data break point (read mode)
   KDB(0)> wr  //print current data break points
   CPU 0: sysinfo+000000 eaddr=003BA9D0 vsid=00000000 size=8 hit=0 mode=R
   CPU 1: sysinfo+000000 eaddr=003BA9D0 vsid=00000000 size=8 hit=0 mode=R
   KDB(0)> e  //exit the debugger
   ...
   Watch trap: 003BA9D4 <sysinfo+000004>
   .fetch_and_add+000008   lwarx    r3,0,r6             r3=sysinfo+000004,r6=sysinfo+000004
   KDB(0)> cw  //clear data break points