ftp.nice.ch/Attic/openStep/developer/resources/CrashTrap.1.6.README

This is the README for CrashTrap.1.6.s.s.tgz [Download] [Browse] [Up]

OEObject 1.6
An OPENSTEP Crash Trap

Art Isbell
arti@lava.net
30 Nov 1997

Description

	OEObject is a free NSObject class poser that is designed to trap several types of
application errors that would normally lead to an abnormal termination.  These errors include
various fatal signals, messages sent to freed objects, and messages that aren't recognized by
the receiver.  OEObject can be used to log a stack backtrace to help identify a programming
error even when a process isn't run under gdb.  It can also be used to prevent the process
from crashing thus allowing the user to try to continue or to gracefully exit the process,
possibly saving changes, instead of the process just disappearing or the dreaded Dr. Watson
(Windows) rearing its ugly head. 

	OEObject was originally a NEXTSTEP class called ObjectError which morphed into
HKCrashTrap, at least one commercial crash catcher, and possibly other versions, but it has
now been ported to OPENSTEP as OEObject.  During the porting process, the stack backtrace
message was reformatted to provide a little better info about method arguments.  Support for
Windows exceptions and end-of-line characters was also added. 

Usage

	Add OEObject to an app or tool project or to the project of a framework that is loaded
by apps and tools.  Send OEObject a setup message early in the process' execution.  If you
want the process to try to continue execution after a normally fatal error has occurred, send
OEObject a setContinueAfterError: message with YES as its argument.  If you want to provide
users with an indication that a crash condition has occurred, then catch the exception raised
by OEObject and implement the user alert in the exception handler. 

	Several defaults variables are provided to adjust the number of function arguments
printed (default is 4), the maximum number of frames printed in the backtrace (default is 50),
and the maximum argument description length printed in the backtrace (default is 255 bytes). 

	The names of the exception and the defaults variables are returned by OEObject methods
to avoid problems passing global constants in the Windows environment. 

	When OEObject isn't configured to continue execution after a fatal error, a crash
backtrace is printed by NSLog().  Under Windows NT, backtraces are printed in the Application
event log which is viewable using Event Viewer. 

	An example project, CrashTrap, is included.  This was ported to OPENSTEP from the
HKCrashTrap distribution. 


Known Problems

    Using OEObject with gdb can be problematic because OEObject can intercept signals that gdb
uses to break on errors.  Using a defaults variable to turn off OEObject during a debugging
session is a convenient solution. 

	No support for PowerPC is included.

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.