[comp.sys.amiga] Debugging with direct I/O

karl@sugar.UUCP (Karl Lehenbauer) (09/02/87)

In article <4160003@hpspdla.HP.COM>, Paul Zander writes:

> ......  It would send the
> write to the buffer, then proceed to the fatal error, leaving
> some of the diagnostics still in the buffer!  

If one is using Unix or a Unix-like stdio-type C library, one would call
fflush after writing the diagnostic message.  Of course, this effectively 
defeats the buffering.

Realize that the opposite problem can occur.  If your program does physical
I/O with wait to print it's debug messages, it's interaction with external
events/devices may change.  For example, an external receiving device may time 
out because your program didn't get the data there in time as it was too
busy printing debugging messages.

On this realtime SCADA system (RCS7) that ran under RSX-11M+ (blech) we had a 
debug output routine that wrote the data to sort-of-a-multiplexed-pipe where a 
program would dequeue it and print it out.  It worked pretty well.
-- 
...!soma!uhnix1!sugar!karl    "Life is wasted on the living." - Z.B. IV