HP-UX Reference (11i v2 04/09) - 3 Library Functions A-M (vol 6)
_
_UNW_currentContext(3X) _UNW_currentContext(3X)
(Itanium(R)-based Systems Only)
_UNW_STEP_NO_DESCRIPTOR_FOR_NON_LEAF
The stack unwind library could not find an unwind descriptor for a procedure which the
stack unwind library can prove is not a leaf procedure. All non-leaf procedures are
required to have unwind descriptors. Some but not all possible causes for this include
• code that does not conform to the coding conventions specified in Itanium Processor
Family Software Conventions and Runtime Architecture , Chapter 11.3 Coding con-
ventions for reliable unwinding
• failure of a
_UNW_LoadMapFromIP
callback function (see unwind(5)) to identify
the location of the unwind header or text segment base
• corrupted system memory
• initialization of the
_Unwind_Context
with incorrect values
_UNW_STEP_CORRUPT_DESCRIPTOR
The unwind descriptor for the frame was mis-formed. This return code indicates the
_Unwind_Context
is in state Bad. See the STATES section in unwind(5).
_UNW_STEP_RSE_NOT_FLUSHED
The register stack engine was not flushed. See unwind(5). This return code indicates
the
_Unwind_Context
is in state Bad. See the STATES section in unwind(5).
_UNW_currentContext
has the following return codes:
_UNW_OK All’s well.
_UNW_CURRENT_CONTEXT_FAILED
A generic problem occurred during a call to _UNW_currentContext
.
_UNW_STEP_CORRUPT_DESCRIPTOR
The unwind descriptor for the frame was mis-formed. This return code indicates the
_Unwind_Context is in state Bad. See the STATES section in unwind(5).
_UNW_MEMORY_ALLOCATION_ERROR
The stack unwind library cannot allocate enough memory to perform the function
requested. _Unwind_Context is in state Bad. See unwind(5).
_UNW_INTERNAL_ERROR
Some logic problem occurred during step. Contact HP support.
ERRORS
_UNW_currentContext
fails gracefully (that is, returns an appropriate error) if there is not enough
memory to perform the initialization or a library interaction problem (for example, calls to the service
manager or
dlmodinfo) prevents unwindlib from performing the initialization.
EXAMPLES
Initialize the value of General Register 5 to 400:
#include <unwind.h>
main() {
_Unwind_Context *uc;
_UNW_ReturnCode retcode;
uc = _UNW_createContextForSelf();
if ((retcode = _UNW_setGR(uc,5,400)) != _UNW_OK) {
/* Notify client: Initialization problem */
}
}
AUTHOR
_UNW_currentContext(), _UNW_jmpbufContext(), _UNW_clear(), _UNW_setGR(),
_UNW_setGR_NaT(), _UNW_setFR(), _UNW_setBR(), _UNW_setAR(), _UNW_setPR(),
_UNW_setPreds(), _UNW_setIP(), _UNW_setCFM(), _UNW_GR_PhysicalNumber(),
_UNW_FR_PhysicalNumber(), _UNW_PR_PhysicalNumber(), and _UNW_step() were
developed by HP.
Section 3−−10 Hewlett-Packard Company − 5 − HP-UX 11i Version 2: September 2004