Trap frames


Trap frames

A trap frame is not structurally different from any other type of stack frame; there is no magic distinguishing characteristic that identifies it as such. However, there are a few things you can look for, since traps don't happen all that often and are handled by special code.

Trap frames have the address of the instruction that caused the trap (or, in the case of an interrupt, the instruction that is just ready to execute) in local register %l1 and the next PC in local register %l2 . This is done, as we mentioned before, by the hardware. The software function handling the trap may do other things with the registers, but normally, at least the PC address is available in %l1 .

Synchronous traps resulting from an instruction will usually have a frame from a "fault" function or "trap" function appearing in the stack trace right after (above) the trap frame. Asynchronous faults, usually due to external device interrupts, can be recognized by the interrupt-handling code. This may be a clock function ("hardclock") or a specific piece of code dedicated to one particular interrupt level (level10). Return addresses on the stack that refer to these functions (interrupt or fault handlers) normally indicate an immediately preceding trap frame. Look for a frame with a code address in %l1 and normally that address plus 4 in %l2 . Device interrupts are usually recognizable by the names of the interrupt service routines; these generally end in " int " ”for example, zsint() might be a service routine for the ZS (serial keyboard/mouse) device.



PANIC. UNIX System Crash Dump Analysis Handbook
PANIC! UNIX System Crash Dump Analysis Handbook (Bk/CD-ROM)
ISBN: 0131493868
EAN: 2147483647
Year: 1994
Pages: 289
Authors: Chris Drake

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net