//
// ----------------------- OEObject Class Interface ---------------------------
//
// Original class (ObjectError) by:
// Bill Bumgarner, Andrew Stone, Mike Morton, and Julie Zelenski
//
// A class that poses as object and does crash-reporting.
// Catches terminating signals (ie seg faults, bus errors)
// and fatal Objective-C runtime errors and writes a backtrace
// out to the console using some shady hacks. This could be modified
// to write backtrace to a file, mail message, etc... if desired.
//
// Modified by Ivo Rothschild (ivo@hasc.ca) to try to continue
// when muddling on.
//
// Attempted port to OpenStep by Subrata Sircar (subrata_sircar@next.com).
//
// Attempted enhancements for OS/NT by Art Isbell (arti@lava.net).
//
// Use at own Risk (so sayeth the authors).
//
// NO WARRANTY:
// ANY IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
// IS HEREBY DISCLAIMED. IN NO EVENT WILL THE AFOREMENTIONED PARTIES BE LIABLE
// FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
// DAMAGES ARISING OUT OF THE USE OF OR INABILITY TO USE THIS CODE.
// ----------------------------------------------------------------------------
//
// ----------------------------- Header Files ---------------------------------
#import <Foundation/NSObject.h>
// ---------------- Typedef, Struct, and Union Declarations -------------------
// --------------------- Constant and Enum Definitions ------------------------
// The following mess is brought to you by Microsoft :-( If OEObject is
// defined in a framework, then _OEOBJECT_BUILDING_DLL (or your own equivalent)
// must be defined when the framework is being built and OE_EXTERN must be
// defined as OEOBJECT_EXTERN (or your own equivalent).
// However, if OEObject is defined in the main project, OE_EXTERN should be
// defined as OEOBJECT_PRIVATE_EXTERN (or your own equivalent).
#ifndef GNUSTEP
#define _OEOBJECT_BUILDING_DLL
// For Windows
#ifdef WIN32
#ifdef _OEOBJECT_BUILDING_DLL
#define _OEOBJECT_WINDOWS_DLL __declspec(dllexport)
#else // _OEOBJECT_BUILDING_DLL
#define _OEOBJECT_WINDOWS_DLL __declspec(dllimport)
#endif // _OEOBJECT_BUILDING_DLL
#ifdef __cplusplus
#define OEOBJECT_EXTERN _OEOBJECT_WINDOWS_DLL extern "C"
#define OEOBJECT_PRIVATE_EXTERN extern "C"
#else // __cplusplus
#define OEOBJECT_EXTERN _OEOBJECT_WINDOWS_DLL extern
#define OEOBJECT_PRIVATE_EXTERN extern
#endif // __cplusplus
// For MACH and PDO
#else // WIN32
#ifdef __cplusplus
// This isn't extern "C" because the compiler will not
// allow this if it has seen an extern "Objective-C"
#define OEOBJECT_EXTERN extern
#define OEOBJECT_PRIVATE_EXTERN __private_extern__
#else // __cplusplus
#define OEOBJECT_EXTERN extern
#define OEOBJECT_PRIVATE_EXTERN __private_extern__
#endif // __cplusplus
#endif // WIN32
// Define OE_EXTERN appropriately.
//#define OE_EXTERN OEOBJECT_PRIVATE_EXTERN
#define OE_EXTERN OEOBJECT_EXTERN
// Name of exception raised to continue execution.
OE_EXTERN NSString *OECrashException;
// Defaults database variable name that specifies the number of function
// arguments printed in backtrace (default is 4)
OE_EXTERN NSString *OEFunctionArgCountDefaultsName;
// Defaults database variable name that specifies the number of frames printed
// in backtrace (default is 50)
OE_EXTERN NSString *OEFrameCountDefaultsName;
@interface OEObject:NSObject
{// -------------------- Instance Variable Declarations ------------------------
@private
@protected
@public
}
// ----------------------- Class Method Declarations --------------------------
+ (void)initialize;
+ (void)setup;
+ (void)setContinueAfterError:(BOOL)aFlag;
+ (void)resumeHandlingCrashes;
+ (void)stopHandlingCrashes;
+ (NSString *)printBacktrace:(NSString *)aMessage;
+ (void)printCurrentStack;
+ (void)printCurrentStackShort;
+ (void)printCurrentStack:(int)stackDepth;
// ---------------- Overridden Instance Method Declarations -------------------
- (void)doesNotRecognizeSelector:(SEL)aSelector;
// ------------------- New Instance Method Declarations -----------------------
// ----------------- Delegate Instance Method Declarations --------------------
@end
#else /* GNUSTEP */
@interface OEObject:NSObject
{}
+ (void)setup;
+ (void)printCurrentStack;
@end
#endif /* GNUSTEP */