HP-UX Reference (11i v2 03/08) - 2 System Calls (vol 5)
p
ptrace(2) ptrace(2)
(PA Only; TO BE OBSOLETED)
PT_GET_EVENT_MASK
This request is used by the calling process to determine the event flags and
signal mask values that have been set in the traced process’s context by the
last PT_SET_EVENT_MASK
request. The data argument specifies the
number of bytes to be read from the traced process’ context into the
ptrace_event data structure pointed to by addr argument. The addr2 argu-
ment is ignored.
The request fails if the number of bytes requested is less than zero or greater
than the size of the ptrace_event structure which results in
errno being set to
[EIO].
PT_GET_PROCESS_STATE
This request is used by the calling process to access state information logged
by the traced process after it has responded to an event. The request reads
data bytes of data from the traced process’s context into the ptrace_state data
structure pointed to by the addr argument. The addr2 argument is ignored.
The ptrace_state data structure is defined in
<sys/ptrace.h> and has the
structure:
typedef struct ptrace_state{
events_t pe_report_event;
int pe_path_len;
pid_t pe_other_pid;
} ptrace_state_t;
The event that the traced process responded to and stopped for is logged in the
pe_report_event member. One of the following structure members
PTRACE_EXEC, PTRACE_EXIT, PTRACE_FORK, PTRACE_SIGNAL
,or
PTRACE_VFORK is logged here. See the definition of events_t in
<sys/ptrace.h> for more details.
If the event that the traced process responded to was
PTRACE_EXEC, then the
pe_path_len member provides the length of the path name string (i.e. the exe-
cutable file path name) not including the null terminating character.
If the event that the traced process responded to was
PTRACE_FORK or
PTRACE_VFORK, then the pe_other_pid member provides the parent’s pid
when accessed from the child’s context, and the child’s pid when accessed from
the parent’s context.
The request fails if the number of bytes requested is less than zero or greater
than the size of the ptrace_event structure and results in
errno being set to
[EIO].
PT_GET_PROCESS_PATHNAME
If the traced process is responded to and stopped for a PTRACE_EXEC event,
then the calling process uses this request to access the path name of the exe-
cutable file that is provided as a path or file argument to exec*(). The
request reads the number of bytes of the path name string specified by the
data argument from the traced process’s context into the data buffer in user
space pointed to by the addr argument. The addr2 argument is ignored. In
the typical case, value in the data argument is equal to the value of the
pe_path_len member of the ptrace_state structure returned via the
PT_GET_PROCESS_STATE request.
If the number of bytes requested is greater than zero but less than the length
of the path name string, then the number of bytes requested is returned. If
the number of bytes requested is greater than the length of the path name
string, then the full path name string (including the null terminating charac-
ter) is returned.
The request fails if the number of bytes requested is less than zero and results
in
errno being set to [EIO].
Section 2−−264 Hewlett-Packard Company − 5 − HP-UX 11i Version 2: August 2003