HP-UX Reference (11i v2 03/08) - 3 Library Functions N-Z (vol 7)
u
uwx(3X) uwx(3X)
(Itanium(R)-based System Only)
EXAMPLE
The following code fragment performs a stack unwind in the current thread:
int status;
struct uwx_env *env;
struct uwx_self_info *info;
uint64_t ip;
env = uwx_init();
info = uwx_self_init_info(env);
status = uwx_register_callbacks(env, (intptr_t)info,
uwx_self_copyin, uwx_self_lookupip);
status = uwx_self_init_context(env);
for (;;) {
status = uwx_step(env);
if (status != UWX_OK)
break;
status = uwx_get_reg(env, UWX_REG_IP, &ip);
printf("IP: %016llx\n", ip);
}
uwx_self_free_info(info);
uwx_free(env);
LIMITATIONS
The Unwind Express library currently has the following limitations:
• It does not recognize X-format unwind descriptors. These are not currently used by HP compilers.
• It does not track or restore the preserved floating-point registers.
• It does not yet provide the proper support for matching NaT bits with the general registers.
ERRORS
For the APIs that return pointer values, a NULL pointer indicates a memory allocation error; otherwise a
pointer to an opaque object is returned.
For other APIs, an integer status code is returned. These codes are listed here.
UWX_OK Request successfully completed.
UWX_BOTTOM uwx_step() hit bottom of stack.
UWX_ABI_FRAME uwx_step() hit a signal context frame.
UWX_ERR_NOENV The env parameter is NULL.
UWX_ERR_IPNOTFOUND
No module information was found for the current frame’s IP.
UWX_ERR_LOOKUPERR The "Lookup IP" callback encountered an error.
UWX_ERR_BADKEY The "Lookup IP" callback returned an invalid key in the result vector.
UWX_ERR_COPYIN_UTBL There was an error reading the unwind table.
UWX_ERR_COPYIN_UINFO There was an error reading the unwind information block.
UWX_ERR_COPYIN_MSTK There was an error reading a value from the memory stack.
UWX_ERR_COPYIN_RSTK There was an error reading a value from the register stack backing store.
UWX_ERR_COPYIN_REG There was an error reading a register from the initial context.
UWX_ERR_NOUDESC An unwind information block was found, but it does not describe the
current frame’s IP.
UWX_ERR_BADUDESC The unwind information block contains an invalid descriptor.
UWX_ERR_NOMEM An attempt to allocate additional memory failed.
UWX_ERR_PROLOG_UF The unwind information block is invalid -- the nesting of prologue
regions is not balanced.
UWX_ERR_UNDEFLABEL The unwind information block is invalid -- an undefined label is refer-
enced.
Section 3−−1116 Hewlett-Packard Company − 6 − HP-UX 11i Version 2: August 2003