Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > Symbols

_UNW_getGR(3X)

Integrity Systems Only
HP-UX 11i Version 3: February 2007
» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

NAME

_UNW_getGR(), _UNW_getAR(), _UNW_getAlertCode(), _UNW_getBR(), _UNW_getCFM(), _UNW_getFR(), _UNW_getGR_NaT(), _UNW_getIP(), _UNW_getKernelSavedContext(), _UNW_getPR(), _UNW_getPreds(), _UNW_clearAlertCode() — query values in unwind library data structure

SYNOPSIS

#include <unwind.h>

uint64_t _UNW_getGR(_Unwind_Context* p, uint32_t num);

_UNW_GR_Value _UNW_getGR_NaT(_Unwind_Context* p, uint32_t num);

_UNW_FR_Value _UNW_getFR(_Unwind_Context* p, uint32_t num);

uint64_t _UNW_getBR(_Unwind_Context* p, uint32_t num);

_UNW_getAR(_Unwind_Context* p, _UNW_AppReg num);

_UNW_Boolean _UNW_getPR(_Unwind_Context* p, uint32_t num);

uint64_t _UNW_getPreds(_Unwind_Context* p);

uint64_t _UNW_getIP(_Unwind_Context* p);

uint64_t _UNW_getCFM(_Unwind_Context* p);

_UNW_ReturnCode _UNW_getAlertCode(const _Unwind_Context *p);

void _UNW_clearAlertCode(_Unwind_Context *p);

DESCRIPTION

_UNW_getGR() returns the value of a numbered general register num in the _Unwind_Context object pointed to by parameter p.

_UNW_getGR_NaT() returns the value and NaT bit of a numbered general register num in the _Unwind_Context object pointed to by parameter p. The values are returned via a structure of type _UNW_GR_Value. The structure's value field contains the register value and the structure's NaT field contains the register NaT bit.

_UNW_getFR() returns the value of a numbered floating point register num in the _Unwind_Context object pointed to by parameter p. The values are returned via a structure of type _UNW_FR_Value. The structure's first_container and second_container fields contain the two consecutive double words of the Floating point register Spill/Fill memory format. See Intel IA-64 Architecture Software Developer's Manual, Volume 1: IA-64 Application Architecture, Section 5.3: Floating Point Instructions.

_UNW_getBR() returns the value of a numbered branch register num in the _Unwind_Context object pointed to by parameter p.

_UNW_getAR() returns the value of an enumerated application register num in the _Unwind_Context object pointed to by parameter p. The enumeration type _UNW_AppReg is used for accessing application registers.

_UNW_getPR() returns the value of a numbered predicate register num in the _Unwind_Context object pointed to by parameter p.

_UNW_getPreds() returns the value of all predicate registers in the _Unwind_Context object pointed to by parameter p. The returned value contains the value of each predicate register in the bit corresponding to the predicate register number — for instance, bit 63 contains the value for predicate register 63.

getIP() returns the contents of the instruction pointer in the _Unwind_Context object pointed to by parameter p.

getCFM() returns the contents of the current frame marker in the _Unwind_Context object pointed to by parameter p.

_UNW_getAlertCode() returns the most recently encountered "client needs to know" return code. If no "client needs to know" conditions have been encountered, _UNW_getAlertCode() returns _UNW_OK. "Client needs to know" return codes are all of the enumerators in the enumeration _UNW_ReturnCode with the exception of _UNW_OK.

_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 otherwise.

_UNW_getAlertCode returns values from the enumeration _UNW_ReturnCode. See Error conditions 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_getAR(), _UNW_getAlertCode(), _UNW_getBR(), _UNW_getCFM(), _UNW_getFR(), _UNW_getGR_NaT(), _UNW_getIP(), _UNW_getKernelSavedContext(), _UNW_getPR(), _UNW_getPreds(), and _UNW_clearAlertCode() were developed by HP.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.