HP-UX Reference (11i v2 04/09) - 3 Library Functions A-M (vol 6)
_
_UNW_getGR(3X) _UNW_getGR(3X)
(Itanium(R)-based Systems Only)
_UNW_clearAlertCode()
clears any ‘‘client needs to know’’ return code in the
_Unwind_Context
object pointed to by parameter p.
_UNW_getKernelSavedContext()
provides the means for a tool such as a kernel debugger to obtain
some of the information it needs about a kernel interruption. The values are returned via a structure of
type
_UNW_KernelSavedContext
structure from which the client can obtain the two fields,
p10_abi_value
and p10_context_value
of the format P10 unwind descriptor. For more detail,
refer to unwind(5) and to Itanium Processor Family Software Conventions and Runtime Architecture .
RETURN VALUE
Except for
_UNW_getAlertCode
, the register value query functions (which are functions with prefix
_UNW_get...) return the requested values on successful completion or a value equivalent to 0 other-
wise.
_UNW_getAlertCode
returns values from the enumeration _UNW_ReturnCode
. See Error condi-
tions and recovery on unwind(5).
_UNW_clear returns _UNW_OK on successful completion. Otherwise
_UNW_clear returns
_UNW_CLEAR_NOT_ALLOWED_IN_STATE
when _Unwind_Context
is not in one of the following
states: Init, User_Interrupted_Frame, User_Sendsig_Frame, Kernel_Bottom_Frame, Frame.
EXAMPLES
Tead the value of General Register 5 in this procedure frame’s context; check for range errors, query
errors, etc.; then finally clear the alert code:
#include <unwind.h>
_Unwind_Context *uc;
_UNW_ReturnCode retcode;
_UNW_GR_Value result;
uc = _UNW_createContextForSelf();
if (_UNW_OK != _UNW_currentContext(uc)) {
/* Notify client: Initialization problem */
}
else {
result=_UNW_getGR_NaT(uc,5);
switch (_UNW_getAlertCode(uc)) {
case _UNW_OK:
break;
case _UNW_QUERY_RANGE_ERROR:
/* Notify user of range error */
break;
default:
/* Notify user of other error */
break;
}
}
_UNW_clearAlertCode(uc);
WARNINGS
See the table in unwind(5), section CLIENT/LIBRARY INTERACTION subsection Queries, which lists
when the values returned by the query functions are guaranteed to reflect the actual register values of
the given procedure’s processor state. Scratch register values, for example, are valid only after crossing a
stack frame associated with an interruption. See Itanium Processor Family Software Conventions and
Runtime Architecture , Chapter 5: Register Usage.
AUTHOR
_UNW_getGR(), _UNW_getGR_NaT(), _UNW_getFR(), _UNW_getBR(), _UNW_getAR(),
_UNW_getPR(), _UNW_getPreds(), _UNW_getIP(), _UNW_getCFM(),
_UNW_getAlertCode(), _UNW_clearAlertCode(), and _UNW_getKernelSavedContext
were developed by HP.
SEE ALSO
_UNW_createContextForSelf(3X), _UNW_currentContext(3X), U_STACK_TRACE(3X), unwind(5).
HP-UX 11i Version 2: September 2004 − 2 − Hewlett-Packard Company Section 3−−13