Trap -- trap specific Domain/OS calls

This program traps specific calls from user programs into global libraries. It cannot trap calls made within user libraries. I wrote it to help figure out Domain internals; it might also prove useful to people trying to figure out what's going wrong deep inside behemoth code. I make no guarantees about this code, it is provided as-is for folks who know what they're doing.

There are two parts to this; the trap command and a trap library. The trap command installs the library, hooks into the known-global table redirecting the trapped calls, and then executes the target program. Unusual calls -- including those which return a value in the a0 register, and those which mess with the stack -- may cause the program to crash or misbehave.

If you have the precompiled binaries (compiled on my SR 10.4 DN3500) you merely have to copy trap_lib to the /lib directory, trap.hlp to the /sys/help directory, and trap to whatever command directory you wish.

If you wish to recompile the programs, you may need some "unreleased" include files -- namely, cl.h, help.h, and strl.h . Reconstructed versions of these are included in this directory, you'll probably have to fiddle with the #include directives.

See the help file trap.hlp for more information about usage.

There are known bugs, including some in the command-line handling. Every trapped call should have a -return and -args flag, even though these are supposed to be optional. I don't promise support, but feel free to e-mail me at roeber@iea.com, roeber@cern.ch, or roeber@caltech.edu.