Display the stack-trace from a given stack frame address.
Syntax:
─┬── K ──┬──┬──────────────────┬─┬──────────────────────┬──── ├── KS ──┤ └── stack-frame ──┘ └── selector:offset ──┘ └── KB ──┘
Parameters:
K
See the R and .R commands for information on changing the default register values.
An address expression may be specified.
See the R command.
The code selector associated with this address is used for two purposes:
Results & Notes:
The K command displays the stack trace, threading through the BP or EBP chain until either an invalid chain pointer is encountered or the command is interrupted by the user. For each stack-frame, the return address and for parameter words or double-words are displayed. The symbol associated with the return address is displayed after the parameter words. An example is given below:
-------------------------------------------------------------------------------##.S 8 ##.R eax=c7c00000 ebx=00000014 ecx=003acd7 edx=0000aff7 esi=00030bff edi=00030000 eip=0000272d esp=0003f8b8 ebp=0003f8c0 iopl=2 -- -- -- nv up ei ng nz na pe nc cs=d02f ss=001f ds=aff7 es=be47 fs=150b gs=0000 cr2=1701d000 cr3=001d9000 doscall1:CONFORM16:postDOSSEMWAIT: d02f:0000272d c9 leave ##K SS:BP CS:IP bdef:0000711e ffff ffff 06d6 0a23 SEEPSMQ + 67 bdef:0000e1df ffff ffff 0bff f91c GETMSGNOINPUT + 4a be1f:00000271 8001 ffff 0000 0000 THK16_CALLUSERTHUNKPROC + 12 be1f:00000003 05ae 0001 0001 0003 THUNKTOINITMOVECURSOR + 3 0020:00000003 0001 0001 0000 0010 0020:00000000 02af 1a03 0197 0000 ##-------------------------------------------------------------------------------
Notes
Such possibilities exist within the system when for example the kernel returns to user code and also within some Presentation Manager components.
In the example above the stack-frame address has been explicitly overridden to use BP since the 16-bit stack selector (1f) is in effect rather than the 32-bit 53 selector.
Warning:
In consequence of these points it recommended that the stack-frame and code selector:offset addresses be explicitly coded when using the K command, as in the example above. In addition the stack trace should be verified with a memory dump of the stack.