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)
by child processes and/or threads. Refer to the EVENTS section below.
If TTEO_NORM_SIGTRAP is set, the SIGTRAP signal behaves normally. That is, it is get-
ting delivered (the default behavior is to drop these signals).
TT_PROC_SET_EVENT_MASK
This request allows the tracing process to establish events and signals the traced process
will respond to. Refer to the EVENTS section for a description of these events.
The addr argument is a pointer to a ttevent_t structure to be copied into the target
process. The data argument specifies the number of bytes to be transferred.
The lwpid and addr2 arguments must be set to zero.
TT_PROC_GET_FIRST_LWP_STATE
This request returns the ttstate_t structure associated with the first thread on the
stopped list. It resets the list pointer to the first entry in the list. The
TT_PROC_GET_NEXT_LWP_STATE request (see below) provides the means to examine
the state of other stopped threads.
The data argument specifies the number bytes to be read from the context of the traced
process into the ttstate_t data structure in user space pointed to by addr. The lwpid
and addr2 arguments must be zero.
The
ttstate_t structure provides the debugger with the means to query the system for
the state of a thread. It is established when a thread enters the debugger stopped state
and, except for the TTS_WAITEDFOR bit, is invariant until the thread is resumed. Its lay-
out is as follows:
typedef struct {
pid_t tts_pid;
lwpid_t tts_lwpid;
uint64_t tts_user_tid;
ttevents_t tts_event;
ttsf_t tts_flags;
int tts_scno;
int tts_scnargs;
uint64_t tts_scarg[SCALL_MAXARGS];
union {
ttexec_data_t tts_exec;
ttfork_data_t tts_fork;
ttsignal_data_t tts_signal;
ttthread_data_t tts_thread;
ttsyscall_data_t tts_syscall;
ttexit_data_t tts_exit;
ttbpt_data_t tts_bpt_sstep;
char tts_fill[128];
} tts_u;
} ttstate_t;
tts_pid
is the process ID.
tts_lwpid is the lwpid of the stopped thread.
tts_user_tid is the thread’s user ID.
tts_event is the event that caused the stop (TTEVT_NONE if the thread stopped
because of a ttrace command).
The tts_flags provide information about the state of the thread before it was stopped.
The information specifies whether or not the thread has been waited for by
ttrace_wait() , whether or not it is processing a system call, whether it is a 32-bit or a
64-bit process and whether the thread is in the exit() system call. The values are as fol-
lows:
TTS_WASSUSPENDED = 0x0001
TTS_WASSLEEPING = 0x0002
TTS_WASRUNNING = 0x0004
TTS_WAITEDFOR = 0x0008
HP-UX Release 11i: December 2000 − 3 − Section 2−−415
___
___