HP-UX Reference (11i v1 00/12) - 2 System Calls (vol 5)
__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man2/!!!intro.2
________________________________________________________________
___ ___
t
ttrace(2) ttrace(2)
across fork() using the tte_opts options in the ttevent_t structure. If TTEO_PROC_INHERIT
is set, the child process inherits the event mask of its parent. If TTEO_LWP_INHERIT is set, the lwp
inherits the event mask of the lwp that invoked fork(). If the latter is set, the lwp created by
lwp_create() also inherits the event mask of the creating thread.
These events are:
TTEVT_SIGNAL This event flag indicates that the traced thread needs to examine signal mask bits when
processing signals. This means that, by default, threads stop when receiving a signal. If
the signal being processed has its mask bit set, signal processing continues as though
the process were not traced: the traced thread is not stopped, and the tracing process is
not notified of the signal. On the other hand, if the signal mask bit is not set for the sig-
nal being processed, the traced thread is stopped and the tracing process is notified via
ttrace_wait() .
Note that the SIGKILL signal can never be unmasked. It behaves as though its mask
bit were always set. This means that a SIGKILL signal cannot be used to stop a traced
thread. The SIGTRAP signal is also special in that it is used to stop traced threads
when they respond to a trap, such as a breakpoint or a single step. Consequently,
masking SIGTRAP, even though allowed, will result in unexpected behavior in these
conditions.
TTEVT_FORK This event flag indicates that the traced thread needs to take special action when it
invokes fork(). When set, both the parent thread and the initial thread in the child
process stop (after the child process is marked as a traced process and adopts its
parent’s debugger). Both threads log the fact that they stopped in response to a
TTEVT_FORK event. The parent thread provides the pid of the child process in the
appropriate portion of the ttstate_t structure. The initial thread of the child pro-
cess provides the pid of the parent in the same location. See the ttstate_t structure
description for further details.
TTEVT_VFORK This event flag indicates that the traced thread needs to take special action when it
invokes
vfork(). The behavior is identical to that of TTEVT_FORK but it is impor-
tant to note that the caveats with respect to vfork(), continue to apply here. In par-
ticular, it needs to be remembered that when the child process stops, its parent is
asleep, and that the child borrows the parent’s address space until a call to exec() or
an exit (either by a call to
exit() or abnormally) takes place. Continuing the parent
process before the above steps take place results in an error.
TTEVT_EXEC This event flag indicates that a traced thread needs to notify the debugger upon comple-
tion of loading the new executable file, in the exec() system call. The length of the
pathname string (not including a null terminating character) is returned in the
ttstate_t structure and the path may subsequently be obtained using the
TT_PROC_GET_PATHNAME request.
TTEVT_SYSCALL_RETURN
This event flag indicates that the traced process will notify the debugger upon return of
all system calls. The traced process will also provide the following information: the sys-
tem call number, its number of arguments and all its arguments, its return value and its
error return in the ttstate_t structure. If the system call is a fork(), vfork()
or exec() and if, respectively, the
TTEVT_FORK, TTEVT_VFORK or TTEVT_EXEC
event is set, only the notification associated with these events is performed. See the
TT_PROC_SET_SCBM request.
TTEVT_SYSCALL_ENTRY
This event flag requests notification of system call entry points. By default, all system
calls stop at this event if it is selected. The information provided is the same as for
TTEVT_SYSCALL_RETURN events but the return value and error are always zero.
TTEVT_SYSCALL_RESTART
Identical to TTEVT_SYSCALL_ENTRY but for system call restarts.
TTEVT_EXIT This event flag indicates that the traced process needs to notify the debugger action
when it invokes exit(). When set, the traced thread stops while still potentially mul-
tithreaded.
TTEVT_LWP_CREATE
This event flag indicates that the debugger wants to be notified when the
HP-UX Release 11i: December 2000 − 7 − Section 2−−419
___
___