HP-UX Reference (11i v2 03/08) - 2 System Calls (vol 5)

t
ttrace(2) ttrace(2)
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 the 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
layout 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;
ttprefork_data_t tts_prefork;
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
follows:
TTS_WASSUSPENDED = 0x0001
TTS_WASSLEEPING = 0x0002
TTS_WASRUNNING = 0x0004
TTS_WAITEDFOR = 0x0008
TTS_INSYSCALL = 0x0010
TTS_IS32BIT = 0x0020
TTS_ATEXIT = 0x0040
The following three arguments provide information regarding the system call being exe-
cuted when the thread was stopped. This information is valid only if the
TTS_INSYSCALL bit is set in tts_flags.
tts_scno is the system call number.
tts_scnargs is the number of arguments of the system call.
HP-UX 11i Version 2: August 2003 4 Hewlett-Packard Company Section 2441