A fatal error, especially in DEBUG, should result in a core.

This issue is especially helpful in the case of the Val::CONVERTER error and having:

"fatal error in <no location>: Val::CONVERTER ..."

Nebulous error and sans location, it is extremely hard to figure out the culprit. Thus, if Bro is built DEBUG, fatal should provide a core.

This subtle change prevents having to change FatalErrors to FatalErrorWithCore everywhere.
This commit is contained in:
Aaron Eppert 2015-03-18 11:15:38 -04:00
parent e3cc7aa48f
commit 2088928fb6

View file

@ -88,7 +88,11 @@ void Reporter::FatalError(const char* fmt, ...)
va_end(ap);
set_processing_status("TERMINATED", "fatal_error");
#ifdef DEBUG
abort();
#else
exit(1);
#endif // DEBUG
}
void Reporter::FatalErrorWithCore(const char* fmt, ...)
@ -393,4 +397,3 @@ void Reporter::DoLog(const char* prefix, EventHandlerPtr event, FILE* out,
if ( alloced )
free(alloced);
}