HP-UX Reference (11i v2 07/12) - 3 Library Functions A-M (vol 6)
_
_UNW_currentContext(3X) _UNW_currentContext(3X)
(Itanium(R)-based System Only)
• code that does not conform to the coding conventions specified in Itanium Processor
Family Software Conventions and Runtime Architecture, Chapter 11.3 Coding conven-
tions 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.
SEE ALSO
U_STACK_TRACE(3X), _UNW_createContextForSelf(3X), _UNW_getGR(3X), unwind(5).
74 Hewlett-Packard Company − 5 − HP-UX 11i Version 2: December 2007 Update