SMPProgAdd - Kernel Debugger: Difference between revisions
No edit summary |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{IBM-Reprint}} | |||
{{SMPProgAdd}} | |||
The Kernel Debugger is essentially a replacement OS/2 Kernel module that contains a built-in debugger component. The kernel debugger can be used to halt system execution, inspect and alter memory and registers, and display system control blocks. The kernel debugger is described in detail in ''The OS/2 Debugging Handbook - Volume II'', IBM publication number SG24-4641. | The Kernel Debugger is essentially a replacement OS/2 Kernel module that contains a built-in debugger component. The kernel debugger can be used to halt system execution, inspect and alter memory and registers, and display system control blocks. The kernel debugger is described in detail in ''The OS/2 Debugging Handbook - Volume II'', IBM publication number SG24-4641. | ||
Line 34: | Line 34: | ||
== KDB Communications Protocol == | == KDB Communications Protocol == | ||
* [[CPGuide - Kernel Debugger Communications Protocol|Kernel Debugger Communications Protocol]] | |||
Communications | |||
| | |||
=== General Considerations === | === General Considerations === | ||
Line 114: | Line 40: | ||
=== Kernel Debugger Packet Responses === | === Kernel Debugger Packet Responses === | ||
[[CPGuide_-_Kernel_Debugger_Communications_Protocol#Kernel_Debugger_Packet_Responses|Kernel Debugger Packet Responses]] | |||
=== Events Reported by the Kernel Debugger === | === Events Reported by the Kernel Debugger === |
Latest revision as of 22:22, 19 May 2025
Reprint Courtesy of International Business Machines Corporation, © International Business Machines Corporation
The Kernel Debugger is essentially a replacement OS/2 Kernel module that contains a built-in debugger component. The kernel debugger can be used to halt system execution, inspect and alter memory and registers, and display system control blocks. The kernel debugger is described in detail in The OS/2 Debugging Handbook - Volume II, IBM publication number SG24-4641.
The kernel debugger architecture is such that only one thread can be in the debugger at any given time. The kernel debugger in OS/2 Warp Server for SMP serializes its access using a spinlock.
When entered, the debugger informs the user of the state of all the processors, even though the other processors are still executing code. This is accomplished by sending a spin command via an interprocessor interrupt, or IPI, to all the other processors. When a processor receives the spin command, it saves its current state information, acknowledges receiving the command, and then spins. This allows the debugger to switch to a slot which is currently executing on another processor and determine what it is doing.
New and Changed Commands
All kernel debugger commands work as before, but a few have been modified to display or use multiprocessor-specific information. New commands have also been added.
The new and changed commands are:
- .DP (processor status) The .DP command has been added to dump out a processor control block verbosely, that is, to display a processor's status. The command takes as an argument:
* * Displays status based on the real current slot * # Displays status based on the currently selected slot * 0-based processor number Displays status for a specific processor. .DP 3 would display the status of processor 3. * blank Displays the status of all processors.
- .DL (display processor spinlocks) The .DL command has been added to display the spinlocks owned by a particular processor. Valid arguments are:
* * Displays spinlocks based on the real current slot * # Displays spinlocks based on the currently selected slot * 0-based processor number Displays spinlocks for a specific processor. .DL 1 would display the spinlocks held on processor 1. * Address of a spinlock Displays a specific spinlock. * blank Displays all spinlocks.
- .DS Dumps the Inter-Processor Interrupt (IPI) statistics for each processor, including the IPI type and IPI delivery method.
- .DSH Dumps the IPI history, which is the last 256 IPIs generated in the system. The source, destination, and type of the IPI are displayed as well as the IPI delivery method and the address and symbol name where the IPI was generated.
- .PQ Dumps the scheduler's priority queues based on the debugger's slot number.
- .R and R (register commands) The register commands have been enhanced to indicate which processor the currently selected slot is running on. This information is displayed at the end of the third register line in the form p=xxyy where xx is the 1-based processor number, and yy are the flags. A processor number of 00 means that the currently selected slot is not running on any processor, or is blocked. The flags are:
* s processor is currently spinning. * r processor is attempting to grab the ring 0 suspend lock.
- .SS (change current slot) The .SS command has been modified to reference the proper PSA (processor save area) when displaying a variable on a different processor.
- .S The .S command is now identical to the .SS command. The PLMA is displayed properly for each processor.
KDB Communications Protocol
General Considerations
Kernel Debugger Packet Responses
Kernel Debugger Packet Responses
Events Reported by the Kernel Debugger
The following is a summary of the data reported when the kernel debugger sends an event in packet mode: