unwind.5 (2010 09)
u
unwind(5) unwind(5)
(Itanium(R)-based Systems Only)
uint64_t is a signed 64-bit integer.
int32_t is a signed 32-bit integer.
int64_t is an unsigned 64-bit integer.
The value query and initialization functions use several structures for passing values. They are as fol-
lows:
Structure
_UNW_KernelSavedContext
has two fields of type
uint32_t:
p10_abi_value and p10_context_value
.
Structure
_UNW_FR_Value
has two fields of type uint64_t: first_container
and
second_container
.
Structure
_UNW_GR_Value
has a field of type uint64_t, value, and a field of type
_UNW_Boolean, NaT.
The enumeration
_UNW_AppReg is used by functions
_UNW_getAR and _UNW_setAR when querying
and setting values of application registers.
_UNW_AppReg
has enumerators _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,
_UNW_AR_EC, and
_UNW_AR_LIST_COUNT
.
_UNW_AR_FIRST_REG
is a synonym for _UNW_AR_RSC.
COMMUNICATING AND LOCATING UNWIND INFORMATION
The definition of the Itanium-based unwind architecture is contained in Chapter 11 of Itanium Processor
Family Software Conventions and Runtime Architecture . That document discusses the need for an
unwind mechanism and the Runtime Architecture conventions that must be observed, and provides
details about the layout and semantics of the unwind information blocks. It leaves environment-
dependent details including the method of locating the unwind table to to be defined and handled by the
Operating System environment. The stack unwind library handles these environment-dependent details
for the client. Users interested in learning the environment-dependent details of the unwind information
should refer to documents in the IA-64 Runtime Architecture Supplement series including the document
entitled Processor-Specific ELF Supplement for IA-64.
Callbacks
In order to perform the task of stack unwinding, the stack unwind library needs to determine the text
base, the unwind header location and the value of the global data pointer (general register
GP
) for any
given load module (which is identified by any valid instruction address within the load module). Unwind
functions such as
U_STACK_TRACE()
and the stack unwind library’s exception handling support make
use of dlmodinfo (3C) to obtain these values. Clients (such as debuggers) using the stack unwind library
to perform a cross-process unwind need to register a function during the stack unwind library data struc-
ture construction to perform this lookup task in the place of
dlmodinfo. The function has type
_UNW_LoadMapFromIP
. The semantics of and the interface to the lookup function are defined in
_UNW_createContext(3X)
Furthermore, the stack unwind library needs the ability to read values from the target process memory
(or memory image if the process is dead). Clients using the stack unwind library to perform a cross-
process unwind need to register a function during data structure construction to perform memory reading
tasks (in place of direct memory references). The function has type
_UNW_ReadTargetMem. The
semantics of and the interface to the memory reader function are defined in _UNW_createContext(3X).
CLIENT/LIBRARY INTERACTION
The steps a client takes to perform a stack unwind operation include
• construction of an _Unwind_Context data structure
• initialization of the
_Unwind_Context
• stepping the _Unwind_Context
• querying the _Unwind_Context
• possibly clearing and reinitialization the _Unwind_Context
• finally, destruction of the _Unwind_Context.
Note: a client throwing an Exception uses a language independent API managed by the aCC standards
committee. See ,CR http://www.codesourcery.com/cxx-abi/abi.html .
4 Hewlett-Packard Company − 4 − HP-UX 11i Version 3: September 2010