HP-UX Reference (11i v2 04/09) - 3 Library Functions N-Z (vol 7)
u
uwx(3X) uwx(3X)
(Itanium(R)-based System Only)
The Copy-In Callback
The "Copy in" callback is used for obtaining values from the address space of the process being unwound.
Its prototype is given in <uwx.h> as follows:
typedef int (*copyin_cb)(
int request,
char *loc,
uint64_t rem,
int len,
intptr_t tok
);
The unwind engine passes the following parameters to the callback routine:
request Identifies the type of request that the unwind engine is making.
loc Address in local memory where the requested data should be placed. This address will
always be properly aligned for an object of the requested length.
rem Address in remote memory from which remote data should be read, or the identifier of a
register to be read from the context of the target process.
len Number of bytes to read from the target address space. For
UWX_COPYIN_UINFO
requests, it will always be either 4 or 8; for all other requests, it will always be 8.
tok The callback token.
The unwind engine uses this callback for four types of requests:
UWX_COPYIN_UINFO
Read data from the unwind information area of the target process. Since
this area is in the text segment, a debugger may choose to read this infor-
mation directly from the file or from a copy in local memory instead of
from the target process.
UWX_COPYIN_MSTACK
Read data from the memory stack of the target process.
UWX_COPYIN_RSTACK
Read data from the register stack backing store of the target process.
Special considerations may be necessary for portions of the backing store.
(For example, on HP-UX, reading from an area between BSP and
BSPSTORE using either
ttrace() or the uc_access library requires
a special request type.)
UWX_COPYIN_REG Read data from a register in the current process context. If unwinding
was initiated or resumed from a signal context record, this request should
read data from the signal context record.
For all but
UWX_COPYIN_REG
requests, the rem parameter contains the address in remote memory from
which data should be read. This address will always be properly aligned for an object of the requested
length.
For
UWX_COPYIN_REG requests, the rem parameter contains the register identifier of the register whose
value is needed. The register identifier will be one of the following:
UWX_REG_PFS ar.pfs
UWX_REG_PREDS predicates (PR0-PR63)
UWX_REG_RNAT ar.rnat
UWX_REG_UNAT ar.unat
UWX_REG_FPSR ar.fpsr
UWX_REG_LC ar.lc
UWX_REG_GR(x) GRx (1 - 31)
UWX_REG_FR(x) FRx (2 - 127)
UWX_REG_BR(x) BRx (0 - 7)
On a successful copy in operation, the callback must return the number of bytes read (which must match
the len parameter). If an error occurs, the callback should return 0.
Section 3−−1142 Hewlett-Packard Company − 5 − HP-UX 11i Version 2: September 2004