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)
lwp_create() system call is invoked to create a thread. When set, the calling
thread stops and provides the debugger with the lwpid of the newly created thread.
TTEVT_LWP_EXIT
This event flag indicates that the debugger wants to be notified when a thread is exiting
via the lwp_exit() system call. The thread stops upon entry to the system call.
TTEVT_LWP_TERMINATE
This event flag indicates that the debugger wants to be notified when a caller thread
invokes the lwp_terminate() call on a target thread. When set, the calling thread
stops upon entering the system call and provides the lwpid of the thread to be ter-
minated in the ttstate_t structure.
TTEVT_LWP_ABORT_SYSCALL
This event flag indicates that the debugger is to be notified when the
lwp_abort_syscall() system call is invoked. The lwpid of the target thread is
provided in the ttstate_t structure.
TTEVT_BPT_SSTEP
This event flag tells the kernel to perform event-based single-stepping and breakpoint
notification. If this event is requested, SIGTRAP loses all special meaning. It is highly
recommended that debuggers use this event instead of the old signal-basedmethod as it
will allow breakpoints and single-steps to take place regardless of the signals the thread
is blocking. Unlike the signal-based method, it also guarantees that single-steps and
breakpoints events are generated in the context of the thread even if other threads are
active in the process.
Note that mixing signal-based and event-based breakpoint/single-stepping may result in
unexpected SIGTRAPs being posted to the process being debugged.
DEPENDENCIES
If the addr argument to a TT_LWP_CONTINUE
or TT_LWP_SINGLE request is not TT_NOPC, the
Instruction Address Offset Queue (program counter) is loaded with the values addr and addr+4 before exe-
cution resumes. Otherwise, execution resumes from the point where it was interrupted.
Additional requests are available:
TT_LWP_RUREGS With this request, the words at offset addr in the
save_state structure are
returned to the tracing process. The data argument is the size of the read. The
addr2 argument points to the location in the debugger space where the data will be
written. The addr argument must be word-aligned and addr+data must be less or
equal to
sizeof (save_state_t) (see
<machine/save_state.h>).
NOTE: Only 4 and 8 bytes reads and writes are currently supported.
TT_LWP_WUREGS With this request, data bytes of data pointed to by addr2 are written at offset addr in
the save_state structure. Only these locations can be written in this way: the
general registers, most floating-point registers, a few control registers, and certain
bits of the interruption processor status word.
NOTE: Only 4 and 8 bytes reads and writes are currently supported.
ERRORS
If a request fails, ttrace returns -1 and errno is set to one of the following:
[EINVAL] request is an illegal number.
[EINVAL] A non-zero value has been passed in a parameter expecting a zero value or vice-versa.
[EINVAL] The data argument of TT_PROC_SETTRC or TT_PROC_ATTACH
is not
TT_VERSION.
[EINVAL] Size too large for data transfer.
[EINVAL] Invalid signalnumber.
[EINVAL] Misaligned request or not a word multiple (TT_PROC_RDTEXT,
TT_PROC_WRTEXT).
[EINVAL] Invalid signal(
TT_LWP_CONTINUE
, TT_LWP_SINGLE).
Section 2−−420 − 8 − HP-UX Release 11i: December 2000
___
___