home *** CD-ROM | disk | FTP | other *** search
- This is an attempt at a tracer for ixemul.library. Since it scans every
- call made thru the library base, it catches even more calls than for
- example SnoopDOS.
-
- Since tracing support slows down *all* clients of the library (as each
- call is now routed thru tracing functions), there are two library
- versions. ixemul.library itself doesn't contain tracing support, using
- the tracer with this library gives you a "Function not implemented"
- error. To use the tracer you have to load ixemul.trace as the main
- library. See below for more detailed instructions.
-
-
- The tracer itself is quite straight forward, a lot more calls could use
- more descriptive parameters, its mostly typing work, but I didn't feel
- like providing more ioctl, open, pipe like print functions ;-))
-
- The option you're most certainly going to use is `-m', as the library
- uses sigsetmask() internally a lot, and its mentioning would just clutter
- the overwhole display.
-
-
- Short instructions to get the tracer up
- ---------------------------------------
- o flush ixemul.library out of the system (the WB option `FlushLibs' can
- do that for you, AVAIL FLUSH achieves the same)
- o make sure the system loads ixemul.trace instead of ixemul.library
- next time it tries to fire up ixemul.library. I usually do this by
- using
- LoadLib ixemul.trace
- But loadlib is not an official CLI command, so you might as well
- have to fiddle with libs:ixemul.library to achieve the desired effect.
- o Start the tracer (probably in its own window), the following options
- are currently recognized (see trace.c as well):
- -a print all calls, even those considered `not interesting', for
- example internal stdio calls, 32bit arithmetic emulation for 68000,
- and such stuff you generally don't want to see.
- -i normally, the tracer shows a function call when that function returns,
- to be able to display the return value (and `errno' in parenthesis).
- When you specify `-i', it always displays function on entry, instead
- of on exit. See below for current problems without the -i option!
- -m skip sigsetmask calls. This function is used extensively inside
- the library, and will in most cases just clutter the tracer output
- with information you don't want to see.
- -o specify a logfile. If -o is omitted, output goes to stdout.
- -p only print output from a specific process. You have to provide the
- decimal address of the process (ok ok, this is not too user-friendly,
- I'm open to better alternatives ;-)). Default is to scan all current
- ixemul clients.
- -s only print calls to specific system call. You have to specify the
- number as found in <sys/syscalls.def>. Again, this option could be
- much more user-friendly, but I'm a lazy guy;-)
-
- You should now see a log of all functions involved from your program(s),
- and some functions involved as a consequence of your functions from inside
- the library. The output means:
-
- $7588790: <strcmp("foo", "-n")=57 (0)
- ^ ^ ^ ^ ^
- | | | | errno value
- | | | result of function
- | | parameters
- | type of log, < means exit, > means entry
- process address
-
-
- Some known problems
- -------------------
- There seems to be some race condition, that can result in deadlock when
- running without the -i flag. I don't know, where the problem lies, such
- stuff is really hard to find...
-
- Currently, if trace-on-exit is enabled, the function is called with
- 16 arguments, no matter how many arguments you passed to it. This should
- be enough for 99% of all applications, but you may have more than 16 arguments
- to a printf() somewhere.
-
- Functions returning more than a 4byte result *don't* work unless you specify
- the -i option!!
-
-
- Happy tracing!
-
- -Markus Wild
-