| 1 |
======================================================================== |
| 2 |
This is the unmodified README from Paul Kranenburg's release of strace |
| 3 |
for SunOS 4.1.x. Some of the notes and instructions are no longer valid |
| 4 |
however the file has been retained for its historical value. -- jrs |
| 5 |
======================================================================== |
| 6 |
|
| 7 |
/* |
| 8 |
* @(#)README 2.4 92/01/21 |
| 9 |
* |
| 10 |
* Copyright (C) 1991 Paul Kranenburg. |
| 11 |
* |
| 12 |
* Please send comments, enhancements or any other useful ideas to |
| 13 |
* the address at the end of this file. |
| 14 |
* |
| 15 |
*/ |
| 16 |
|
| 17 |
strace(1) is a system call tracer for Sun(tm) systems much like the |
| 18 |
Sun supplied program trace(1). strace(1) is a useful utility to sort |
| 19 |
of debug programs for which no source is available which unfortunately |
| 20 |
includes almost all of the Sun supplied system software. |
| 21 |
|
| 22 |
Like trace(1), strace displays each system call and its arguments as it |
| 23 |
is invoked by the traced process, but tries to do a better job of |
| 24 |
decoding the arguments, displaying them in symbolic format whenever |
| 25 |
possible. Passed structures/character arrays are read from the process' |
| 26 |
address space and displayed in an appropriate format. |
| 27 |
|
| 28 |
It is also possible to instruct strace to trace child processes as |
| 29 |
they are created by the fork(2) system call. However, this is slightly |
| 30 |
involved for two reasons: 1) the trace flag is cleared in the child |
| 31 |
process by the fork system call, so we must make a special effort to |
| 32 |
gain control of the child (see NOTES below), 2) our tracing manipulations |
| 33 |
of the child may interfere with a possible wait(2) system call executed |
| 34 |
by the (also traced) parent process. In this case we don't allow the parent |
| 35 |
to continue until one of its children enters a state that may cause the |
| 36 |
parent's wait(2) call to return. |
| 37 |
|
| 38 |
|
| 39 |
NOTES. |
| 40 |
|
| 41 |
o Not all system calls have been implemented yet as described |
| 42 |
above (see dummy.h for a list), these calls only have their args |
| 43 |
displayed as hex numbers. |
| 44 |
|
| 45 |
o The program draws heavily on Sun's extensions to the ptrace(2) |
| 46 |
system call. |
| 47 |
|
| 48 |
o This release is based upon SunOS 4.1.1. The syscall list (syscall.h) |
| 49 |
and ioctl's (ioctlent.m4) are probably most critically dependant |
| 50 |
on the OS version (see also /sys/os/init_sysent.c). |
| 51 |
You may have to edit `ioctlsort.c' and/or `ioctlent.m4' to get |
| 52 |
`ioctlsort.c' to compile with your suite of system header files. |
| 53 |
|
| 54 |
o The way in which child processes are caught and attached to after |
| 55 |
the fork() call is Sparc-specific (in fact it has the looks of a |
| 56 |
terrible hack). Also, this trick won't work with vfork(2). |
| 57 |
Enhancements are sollicited for. |
| 58 |
|
| 59 |
o Dynamically linked executables can be convinced to use the fork(2) |
| 60 |
system call in stead of vfork(2) by modifying their (internal) |
| 61 |
symbol table immediately after such a program is exec'ed. Be |
| 62 |
warned that programs which depend on vfork's peculiar semantics |
| 63 |
may not run as expected. Enable by the `-F' switch. |
| 64 |
|
| 65 |
|
| 66 |
INSTALLATION. |
| 67 |
|
| 68 |
Edit the paths in the Makefile to suit your local system. |
| 69 |
Enter the usual make commands (`make debug' to enable the |
| 70 |
compiler `-g' flag). |
| 71 |
|
| 72 |
Not all sites have a complete set of include files, depending |
| 73 |
on the selected software categories at OS install time. The |
| 74 |
makefile tries to detect the presence of the Sunview category, |
| 75 |
if other files are missing you may have to edit `ioctlent.h'. |
| 76 |
|
| 77 |
|
| 78 |
COMMENTS TO: |
| 79 |
|
| 80 |
P. Kranenburg |
| 81 |
Department of Computer Science |
| 82 |
Erasmus University Rotterdam |
| 83 |
P.O. Box 1738 |
| 84 |
NL-3000 DR Rotterdam |
| 85 |
e-mail: [email protected] |