r and gt subcommands
The r and gt subcommands set non-permanent breakpoints. Non-permanent breakpoints are local breakpoints that are cleared after they are used.
Format
r
gt [-p | -v] [address]
Parameters
Item | Description |
---|---|
-p | Indicates that the breakpoint address is a physical or real address. |
-v | Indicates that the breakpoint address is an effective or virtual address. |
address | Specifies the address of the breakpoint. This may either be a physical or real address. Symbols, hexadecimal values, or hexadecimal expressions may be used in specification of the address. |
The r subcommand sets a breakpoint on the address found in the lr register. In the SMP environment, it is possible to reach this breakpoint on another processor. For this reason, it is important to use the thread or process local break point.
The gt subcommand performs the same function as the r subcommand, but the address must be specified for the gt subcommand.
By default, the KDB kernel debugger chooses the current state of the machine. If the subcommand is entered before VMM initialization, the address is physical. If the subcommand is entered after VMM initialization, the address is virtual (effective address). After VMM is initialized, the -p flag must be used to set a breakpoint in real-mode code that is not mapped V=R, otherwise KDB kernel debugger expects a virtual address and translates the address.
Other
r – return
gt has no aliases.
Examples
The following is an example of how to use the r and the gt subcommands:
KDB(2)> b _iput //enable break point on _iput()
._iput+000000 (sid:00000000) permanent & global
KDB(2)> e //exit debugger
...
Breakpoint
._iput+000000 stmw r29,FFFFFFF4(stkp) <2FF3B1CC> r29=0A4C6C20,FFFFFFF4(stkp)=2FF3B1CC
KDB(6)> f
thread+014580 STACK:
[0021632C]_iput+000000 (0A4C6C20, 0571A808 [??])
[00263EF4]jfs_rele+0000B4 (??)
[00220B58]vnop_rele+000018 (??)
[00232178]vno_close+000058 (??)
[002266C8]closef+0000C8 (??)
[0020C548]closefd+0000BC (??, ??)
[0020C70C]close+000174 (??)
[000037C4].sys_call+000000 ()
[D000715C]fclose+00006C (??)
[10000580]10000580+000000 ()
[10000174]__start+00004C ()
KDB(6)> r //go to the end of the function
...
.jfs_rele+0000B8 b <.jfs_rele+00007C> r3=0
KDB(7)> e //exit debugger
...
Breakpoint
._iput+000000 stmw r29,FFFFFFF4(stkp) <2FF3B24C> r29=09D75BD0,FFFFFFF4(stkp)=2FF3B24C
KDB(3)> gt @lr //go to the link register value
.jfs_rele+0000B8 (sid:00000000) step < ctx: thread+001680 >
...
.jfs_rele+0000B8 b <.jfs_rele+00007C> r3=0
KDB(1)>