ttrace.2 (2010 09)

t
ttrace(2) ttrace(2)
(void) close(pfd1[1]);
(void) close(pfd2[0]);
(void) close(pfd2[1]);
(void) execvp(*argv, argv);
ppid = 0;
errexit("exec");
}
if (read(pfd2[0], (void *) &c, sizeof c) != sizeof c) {
errexit("read");
}
dottrace(TT_PROC_SET_EVENT_MASK, pid, 0,
(uint64_t) &ev, sizeof ev, 0);
/* tell the child to exec */
if (write(pfd1[1], (void *) &c, sizeof c) != sizeof c) {
errexit("write");
}
(void) close(pfd1[0]);
(void) close(pfd1[1]);
(void) close(pfd2[0]);
(void) close(pfd2[1]);
}
dottrace(TT_PROC_CONTINUE, pid, 0, 0, 0, 0);
for (;;) {
int rval = ttrace_wait(pid, 0, TTRACE_WAITOK, &st, sizeof st);
if (rval < 0) {
errexit("ttrace_wait");
}
show_event(&st);
if (st.tts_event == TTEVT_EXIT) {
break;
}
dottrace(TT_LWP_CONTINUE, pid, st.tts_lwpid, TT_NOPC,
st.tts_event == TTEVT_SIGNAL ?
(uint64_t) st.tts_u.tts_signal.tts_signo : 0L, 0L);
}
return 0;
}
WARNINGS
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
execution resumes. Otherwise, execution resumes from the point where it was interrupted.
AUTHOR
ttrace was developed by HP.
SEE ALSO
adb(1), coreadm(1M), coreadm(2), exec(2), fork(2), signal(2), ttrace_wait(2), vfork(2), wait(2),
privileges(5).
STANDARDS CONFORMANCE
ttrace(): LOCAL
HP-UX 11i Version 3: September 2010 21 Hewlett-Packard Company 21