[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
Kernel Extensions and Device Support Programming Concepts

Watch Break Points Subcommands for the KDB Kernel Debugger and kdb Command


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

Note: This subcommand is only available within the kdb command; it is not included in the KDB Kernel Debugger.

On POWER PC architecture, a watch register may be used (called DABR Data Address Breakpoint Register or HID5 on POWER 601) to enter KDB when a specified effective address is accessed. The register holds a double-word effective address and bits to specify load and/or store operation. See PowerPC Implementation Definition for the 601-604-620 Processor (book IV) to have more information. The wr subcommand may be used to stop on load instruction. The ww subcommand may be used to stop on store instruction. The wrw subcommand may be used to stop on load or store instruction. Without argument, the subcommand prints the current active watch subcommand. The cw subcommand may be used to clear the last watch subcommand. This subcommand is global to all processors, each processor may have different watch address with the local subcommands lwr lww lwrw lcw. When no size is specified, the default size is 8 bytes and the address is double word aligned. Otherwise KDB checks the faulting address with the specified range and continues execution if it does not match.

It is possible to specify if the address is physical or virtual with -p or -v option. 604 and 620 processors take care of the translation mode, and it is necessary to specify which mode is used. By default KDB chooses the current state of the machine: if the subcommand is entered beforeVMM inititialisation, the watch address is physical (real address), else virtual (effective address).

Example

   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

[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]