HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_CrashHandler Class Reference

#include <UT_CrashHandler.h>

Public Member Functions

 UT_CrashHandler (const char *app_name)
 
virtual ~UT_CrashHandler ()
 
virtual bool handledSignal (UTsignalHandlerArg arg)
 
virtual void chaser (UTsignalHandlerArg arg)
 
virtual bool traceToStderr () const
 
const char * applicationName () const
 Return the application name. More...
 
void setApplicationName (const char *app_name)
 Set the application name. More...
 
const UT_Signalsignals () const
 Access to signals. More...
 
UTsigHandler signalFunction () const
 Access to signal handler function. More...
 

Static Public Member Functions

static const UT_CrashHandlergetCrashHandler ()
 Access to the singleton. More...
 

Detailed Description

This class handles crashing signals

This must be a singleton object. It traps crashing signals and handles them properly. a) When a thread catches a signal, the signal is passed to the main thread b) A stack trace is can be printed This detects recursion into the signal handler and takes appropriate action

Depending on the environment variable HOUDINI_COREDUMP, houdini will generate a core or

Definition at line 29 of file UT_CrashHandler.h.

Constructor & Destructor Documentation

UT_CrashHandler::UT_CrashHandler ( const char *  app_name)
explicit

Construct using an array of signals. The array should be terminated by a zero.

virtual UT_CrashHandler::~UT_CrashHandler ( )
virtual

Member Function Documentation

const char* UT_CrashHandler::applicationName ( ) const
inline

Return the application name.

Definition at line 69 of file UT_CrashHandler.h.

virtual void UT_CrashHandler::chaser ( UTsignalHandlerArg  arg)
virtual

This virtual allows the signal handler to have a "chaser" function, one which gets called after the stack trace has been printed out, but before core is actually dumped.

static const UT_CrashHandler* UT_CrashHandler::getCrashHandler ( )
static

Access to the singleton.

virtual bool UT_CrashHandler::handledSignal ( UTsignalHandlerArg  arg)
virtual

A subclass gets a chance to handle the signal before the base class takes any action. If the method returns true, the signal handler will just return from the signal handler and the process will continue. The default method returns false, letting the signal be processed properly.

Also, please note that this method may be called multiple times. It may be called from a thread, then from the main thread, even for the same signal. When called for a thread, the same signal will always be invoked for the main thread, so you may only want to do your processing when UT_Thread::isMainThread() is true.

Please note that this is called from within a signal handler. The signal might have been raised within Python, so don't call Python from the handler. The signal handler might have been called within malloc()/free(), so there might be a system lock on malloc, so try not to call malloc/free from within your handler.

void UT_CrashHandler::setApplicationName ( const char *  app_name)
inline

Set the application name.

Definition at line 73 of file UT_CrashHandler.h.

UTsigHandler UT_CrashHandler::signalFunction ( ) const

Access to signal handler function.

const UT_Signal* UT_CrashHandler::signals ( ) const
inline

Access to signals.

Definition at line 77 of file UT_CrashHandler.h.

virtual bool UT_CrashHandler::traceToStderr ( ) const
virtual

Indicate whether the stack trace should be printed to stderr on a crash Defaults to true


The documentation for this class was generated from the following file: