lb subcommand

The lb subcommand sets a permanent local breakpoint in the code for a specific context.

Note: This subcommand is only available within the KDB kernel debugger. It is not included in the kdb command.

Format

lb [-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 can be either an effective or physical address. Symbols, hexadecimal values, or hexadecimal expressions can be used to specify the address.

The context can either be CPU-based or thread-based. Either context is controllable through a set subcommand option. Each lb subcommand associates one context with the local breakpoint and up to eight different contexts can be set for each local breakpoint. The context is the effective address of the current thread entry in the thread table or the current processor number.

If the lb subcommand is used with no parameters, all current trace and breakpoints are displayed.

If an address is specified, the break is set with the context of the current thread or CPU. To set a break using a context other than the current thread or CPU, change the current context using the sw subcommand and the cpu subcommand.

If a local breakpoint is hit with a context that was not specified, a message is displayed, but a break does not occur.

By default, KDB kernel debugger chooses the current state of the machine. If the subcommand is entered before VMM initialization, the address is the physical address or real address. If the subcommand is entered after VMM initialization, the address is the effective or virtual address. After VMM is setup, the -p parameter must be used to set a breakpoint in real-mode for code that is not mapped V=R. Otherwise, the KDB kernel debugger expects a virtual address and translates the address.

Other

lbrk

Examples

The following is an example of how to use the lb subcommand:

   KDB(0)> b execv  //set break point on execv()
   Assumed to be [External data]: 001F4200 execve
   Ambiguous: [Ext func]
   001F4200 .execve
   .execve+000000 (sid:00000000) permanent & global
   KDB(0)> e  //exit debugger
   ...
   Breakpoint
   .execve+000000    mflr    r0                  <.svc_flih+00011C>
   KDB(0)> ppda  //print current processor data area

   Per Processor Data Area [00086E40]

   csa......................2FEE0000  mstack...................0037CDB0
   fpowner..................00000000  curthread................E60008C0
   ...
   KDB(0)> lb kexit  //set local break point on kexit()
   .kexit+000000 (sid:00000000) permanent & local < ctx: thread+0008C0 >
   KDB(0)> b  //display current active break points
   0:      .execve+000000 (sid:00000000)  permanent & global
   1:      .kexit+000000 (sid:00000000)  permanent & local < ctx: thread+0008C0 >
   KDB(0)> e  //exit debugger
   ...
   Warning, breakpoint ignored (context mismatched):
   .kexit+000000    mflr    r0                  <._exit+000020>
   Breakpoint
   .kexit+000000    mflr    r0                  <._exit+000020>
   KDB(0)> ppda  //print current processor data area

   Per Processor Data Area [00086E40]

   csa......................2FEE0000  mstack...................0037CDB0
   fpowner..................00000000  curthread................E60008C0
   ...
   KDB(0)> lc 1 thread+0008C0  //remove local break point slot 1