unwind.5 (2010 09)

u
unwind(5) unwind(5)
(Itanium(R)-based Systems Only)
From User_Interrupted_Frame, the client may call
_UNW_currentContext
or
_UNW_step, which transfers the _Unwind_Context
into states Frame or Bad. The
client may call
clear, which transfers the
_Unwind_Context into state Init . The
client may call
_UNW_destroyContext
, which transfers the
_Unwind_Context
into state Stop.
Kernel_Bottom_Frame
The state indicating the bottom of a kernel call stack. The client may use
_UNW_getKernelSavedContext
while in this state. See
_UNW_getKernelSavedContext (3X)
From Kernel_Bottom_Frame, the client may call
_UNW_currentContext
or
_UNW_step, which transfers the _Unwind_Context
into states Frame or Bad. The
client may call
clear , which transfers the
_Unwind_Context into state Init . The
client may call
_UNW_destroyContext
, which transfers the
_Unwind_Context
into state Stop .
Stop The
_Unwind_Context
has been discarded.
Construction
Construction is performed by a call to either
_UNW_createContextForSelf
or to
_UNW_createContext
. _UNW_createContextForSelf is primarily used when a process
intends to unwind its own stack.
_UNW_createContext
is primarily used when a process intends to
unwind a different process stack or the stack of a dead process preserved in a core file. See
_UNW_createContext(3X), _UNW_createContextForSelf(3X) and subsection Callbacks in section
ACCESSING UNWIND INFORMATION above.
Initialization
The client’s goal when the
_Unwind_Context
is in the Init state is to place a snapshot of the processor
state at a given point of time into the
_Unwind_Context
. The snapshot consists of a set of required
register values. The register stack engine (RSE) must be flushed at the time the snapshot is taken. See
the
flushrs instruction in the processor specification.
Initialization is only allowed while the
_Unwind_Context is in the Init state.
Writes are always allowed to general registers 1-31, Floating Point Registers, Predicate Registers, Branch
Registers, the Current Frame Marker (CFM), the Instruction Pointer (IP), and Application Registers
in the set
_UNW_AR_RSC, _UNW_AR_BSP, _UNW_AR_BSPSTORE
, _UNW_AR_RNAT, _UNW_AR_CCV,
_UNW_AR_UNAT, _UNW_AR_FPSR, _UNW_AR_ITC, _UNW_AR_PFS, _UNW_AR_LC. Writing to a par-
ticular register validates that value in the _Unwind_Context
. Once the current frame marker (CFM)
value is valid, writes to General Registers in the range GR32 through GR32 +
CFM.sof are allowed (for
the purpose of initializing an Itanium-based system’s RSE stacked general registers in the snapshot
procedure’s RSE frame). A set to CFM invalidates the general registers in the range GR32 through
GR127.
Of the above, the following values must be initialized (therefore validated) in order for subsequent calls to
_UNW_step() to be successful:
The Instruction Pointer (IP). See _UNW_setIP (3X)
Preserved and scratch branch registers in the range BR0 through BR7.
Preserved and scratch predicate registers (PR1 through PR63).
Application Registers in the set
_UNW_AR_RSC, _UNW_AR_BSP, _UNW_AR_BSPSTORE,
_UNW_AR_RNAT, and _UNW_AR_PFS.
General registers in the range GR1 through GR31. Note that many general registers are con-
sidered "scratch" general registers. If scratch general registers are not initialized by the client,
subsequent
_UNW_step() calls are still likely (but not guaranteed) to succeed, because most
procedures do not preserve values in Scratch registers. The general unwind descriptors
defined in Table 11-13 of the Itanium Processor Family Software Conventions and Runtime
Architecture do permit procedures to preserve values in Scratch registers, so for thoroughness,
it is required that even the scratch general registers be initialized. The same is true for the
scratch branch, predicate and floating point registers.
Preserved and scratch floating point registers.
6 Hewlett-Packard Company 6 HP-UX 11i Version 3: September 2010