HP-UX Reference (11i v2 07/12) - 2 System Calls (vol 5)

p
ptrace(2) ptrace(2)
(PA-RISC Only; TO BE OBSOLETED)
PT_RUAREA
The word specified by the address in the addr argument in the user area of the traced
process in the system’s address space (see
<sys/user.h> ) is returned to the trac-
ing process. The addresses in this area are system dependent but start at zero and
the limit can be obtained from
<sys/user.h> . The data and addr2 arguments are
ignored.
This request fails if addr is not the starting address of a word or is outside the user
area, in which case the value of
-1 is returned to the tracing process and errno is
set to [EIO].
PT_WDUSER
PT_WIUSER
The value in the data argument is written into the address space of the traced process
at the location specified in the addr argument.
PT_WIUSER writes a word into I
space and
PT_WDUSER writes a word in D space. Upon successful completion, the
value written into the address space of the traced process is returned to the tracing
process. The addr2 argument is ignored.
These two requests fail if addr is not the starting address of a word. It will also fail if
the addr argument is a location in a pure procedure space and either another process
is executing in that space or the tracing process does not have write access to the exe-
cutable file corresponding to that space. A value of
-1 is returned to the tracing pro-
cess if it fails and
errno is set to [EIO].
PT_WUAREA This request is not supported and returns a -1, along with setting errno to [EIO]
(no affect upon the user area of the traced process).
PT_RUREGS The word at the location specified by the addr argument in the save_state structure at
the base of the per-process kernel stack is returned to the tracing process. The addr
argument must be word-aligned and less than STACKSIZE*NBPG
(see
<sys/param.h> and <machine/param.h>
). The save_state structure contains
the registers and other information about the process. The data and addr2 arguments
are ignored.
PT_WUREGS The word at the location specified by the addr argument in the save_state structure at
the base of the per-process kernel stack is updated. Only a few locations can be writ-
ten in this way: the general registers, most floating-point registers, a few control
registers, and certain bits of the interruption processor status word. The addr2 argu-
ment is ignored.
PT_RDDATA
PT_RDTEXT
These requests are identical to PT_RDUSER and PT_RIUSER except that the data
argument specifies the number of bytes to read and the addr2 argument specifies
where to store that data in the tracing process.
PT_WRDATA
PT_WRTEXT
These requests are identical to PT_WDUSER and PT_WIUSER except that the data
argument specifies the number of bytes to write and the addr2 argument specifies
where to read that data in the tracing process.
PT_CONTIN This request causes the traced process to resume execution. If the data argument is
0, all pending signals including the one that caused the traced process to stop, are can-
celed before it resumes execution. If the data argument is a valid signal number, the
traced process resumes execution as if it had incurred that signal and any other pend-
ing signals are canceled. The addr2 argument is ignored.
If the addr argument is not 1, the Instruction Address Offset Queue (program
counter) is loaded with the values addr and addr
+4 before execution resumes. Other-
wise, execution resumes from the point where it was interrupted.
Upon successful completion, the value of the data argument is returned to the tracing
process.
This request fails if the data argument is not 0 or a valid signal number and a value of
-1 is returned to the tracing process and errno is set to [EIO].
PT_EXIT This request causes the traced process to terminate in the same manner as doing an
exit() call. The addr, data, and addr2 arguments are ignored.
HP-UX 11i Version 2: December 2007 Update 2 Hewlett-Packard Company 301