47const char *
kAssertMsg =
"%s violated at line %d of `%s'";
48const char *
kCheckMsg =
"%s not true at line %d of `%s'";
53static const char *__crashreporter_info__ = 0;
54asm(
".desc ___crashreporter_info__, 0x10");
66 TTHREAD_TLS(
Int_t) buf_size = 2048;
67 TTHREAD_TLS(
char*) buf = 0;
74 buf =
new char[buf_size];
76 Int_t n = vsnprintf(buf, buf_size, fmt, ap);
79 if (
n == -1 ||
n >= buf_size) {
95 const char *toprint = buf;
96 fprintf(stderr,
"%s", toprint);
99 ::OutputDebugString(buf);
153 const char *
type = 0;
162 type =
"\n *** Break ***";
170 smsg.
Form(
"%s", msg);
173 else if (!location || !location[0])
176 smsg.
Form(
"%s in <%s>: %s",
type, location, msg);
184 if (__crashreporter_info__)
185 delete [] __crashreporter_info__;
186 __crashreporter_info__ =
StrDup(smsg);
204 TTHREAD_TLS(
Int_t) buf_size(256);
205 TTHREAD_TLS(
char*) buf_storage(0);
208 char *buf = buf_storage ? buf_storage : small_buf;
216 buf_storage = buf =
new char[buf_size];
220 fmt =
"no error message provided";
222 Int_t n = vsnprintf(buf, buf_size, fmt, ap);
225 if (
n == -1 ||
n >= buf_size) {
230 if (buf != &(small_buf[0]))
delete [] buf;
243 const char *toprint = buf;
262 Warning(method,
"this method must be overridden!");
271 Warning(method,
"may not use this method");
281 mess.
Form(
"obsolete as of %s and will be removed from %s", asOfVers, removedFromVers);
288void Error(
const char *location,
const char *
va_(fmt), ...)
291 va_start(ap,
va_(fmt));
302 va_start(ap,
va_(fmt));
310void Break(
const char *location,
const char *
va_(fmt), ...)
313 va_start(ap,
va_(fmt));
321void Info(
const char *location,
const char *
va_(fmt), ...)
324 va_start(ap,
va_(fmt));
335 va_start(ap,
va_(fmt));
346void Fatal(
const char *location,
const char *
va_(fmt), ...)
349 va_start(ap,
va_(fmt));
void Warning(const char *location, const char *va_(fmt),...)
Use this function in warning situations.
static void DebugPrint(const char *fmt,...)
Print debugging message to stderr and, on Windows, to the system debugger.
void DefaultErrorHandler(Int_t level, Bool_t abort_bool, const char *location, const char *msg)
The default error handler function.
ErrorHandlerFunc_t GetErrorHandler()
Returns the current error handler function.
void Fatal(const char *location, const char *va_(fmt),...)
Use this function in case of a fatal error. It will abort the program.
static ErrorHandlerFunc_t gErrorHandler
void Break(const char *location, const char *va_(fmt),...)
Use this function in case an error occurred.
void Error(const char *location, const char *va_(fmt),...)
Use this function in case an error occurred.
TVirtualMutex * gErrorMutex
Error handling routines.
void AbstractMethod(const char *method)
This function can be used in abstract base classes in case one does not want to make the class a "rea...
void Info(const char *location, const char *va_(fmt),...)
Use this function for informational messages.
void ErrorHandler(Int_t level, const char *location, const char *fmt, va_list ap)
General error handler function. It calls the user set error handler.
void SysError(const char *location, const char *va_(fmt),...)
Use this function in case a system (OS or GUI) related error occurred.
void MayNotUse(const char *method)
This function can be used in classes that should override a certain function, but in the inherited cl...
void Obsolete(const char *function, const char *asOfVers, const char *removedFromVers)
Use this function to declare a function obsolete.
ErrorHandlerFunc_t SetErrorHandler(ErrorHandlerFunc_t newhandler)
Set an errorhandler function. Returns the old handler.
Bool_t gPrintViaErrorHandler
void(* ErrorHandlerFunc_t)(int level, Bool_t abort, const char *location, const char *msg)
char * Form(const char *fmt,...)
char * StrDup(const char *str)
Duplicate the string str.
R__EXTERN TSystem * gSystem
#define R__LOCKGUARD2(mutex)
#define R__VA_COPY(to, from)
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
Compare a string to char *cs2.
const char * Data() const
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
virtual void Abort(int code=0)
Abort the application.
virtual const char * GetError()
Return system error string.
virtual void StackTrace()
Print a stack trace.
This class implements a mutex interface.
void function(const Char_t *name_, T fun, const Char_t *docstring=0)