HP-UX Reference (11i v2 03/08) - 3 Library Functions N-Z (vol 7)

u
uwx(3X) uwx(3X)
(Itanium(R)-based System Only)
uint64_t **resultp
);
The unwind engine passes the following parameters to the callback routine:
request Identifies the type of request that the unwind engine is making.
ip The IP for which information is needed.
tok The callback token.
resultp Address of a result vector pointer.
The unwind engine uses this callback for two types of requests:
UWX_LKUP_LOOKUP
Requests the callback to lookup information for the given IP. The callback
must allocate a result vector, place the load information in that vector, and
return a pointer to the result vector in
(*resultp).
UWX_LKUP_FREE Informs the callback when it is safe to free the result vector. A pointer to
the vector returned by the lookup request is passed in (*resultp). The ip
parameter is not used for this request. (If the result vector was not dynami-
cally allocated, this request can be ignored.)
In order to step from one frame to a previous frame on the stack,
libuwx starts with the current IP and
makes a UWX_LKUP_LOOKUP
request to obtain information about this IP.
The callback must return one of the following status codes in response to the
UWX_LKUP_LOOKUP
request:
UWX_LKUP_UTABLE A load module was found. The result vector contains load module and
unwind table information.
UWX_LKUP_NOTFOUND
No information found for this IP.
UWX_LKUP_ERR An error occurred.
In the normal case, the callback obtains the following information about the given IP: base address of its
text segment, starting and ending addresses of the unwind table, and (optional) unwind flags. It places
this information in the result vector, and returns the
UWX_LKUP_UTABLE
status code.
The result vector is an array of pairs of unsigned 64-bit integer values. The first value in each pair is a
key, and the second value in each pair is a corresponding value. The vector is terminated by a key/value
pair whose key is 0.
The following keys can be returned in the result vector:
UWX_KEY_TBASE Base address of text segment.
UWX_KEY_USTART Starting address of unwind table.
UWX_KEY_UEND Ending address of unwind table.
UWX_KEY_FLAGS Unwind flags (HP-UX only).
On HP-UX, the load information can be obtained with the
dlmodinfo() routine (see <dlfcn.h>).
This routine returns a descriptor containing the base address of the text segment and the address of the
unwind header. The unwind header contains the unwind flags, and the segment-relative offsets of the
beginning and end of the unwind table. The callback must convert the segment-relative offsets to virtual
addresses by adding the base address of the text segment. The unwind flags contain a version number of
the unwind table format, and a flag that indicates whether the unwind table contains 32-bit or 64-bit
entries. (On other operating systems, unwind tables always contain 64-bit entries, so the unwind flags do
not need to be provided.)
If the callback does not find any information it returns the
UWX_LKUP_NOTFOUND status code. It should
leave the resultp parameter unmodified.
When the callback returns
UWX_LKUP_NOTFOUND, the unwind engine will assume that the IP belongs to
a leaf procedure with default unwind properties, and will attempt to unwind accordingly.
If any error condition occurs that would prevent the unwind engine from unwinding correctly, the call-
back should return
UWX_LKUP_ERR and leave the resultp parameter unmodified.
Section 31114 Hewlett-Packard Company 4 HP-UX 11i Version 2: August 2003