mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 09:38:19 +00:00
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:
parent
e3cc7aa48f
commit
2088928fb6
1 changed files with 4 additions and 1 deletions
|
@ -88,7 +88,11 @@ void Reporter::FatalError(const char* fmt, ...)
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
set_processing_status("TERMINATED", "fatal_error");
|
set_processing_status("TERMINATED", "fatal_error");
|
||||||
|
#ifdef DEBUG
|
||||||
|
abort();
|
||||||
|
#else
|
||||||
exit(1);
|
exit(1);
|
||||||
|
#endif // DEBUG
|
||||||
}
|
}
|
||||||
|
|
||||||
void Reporter::FatalErrorWithCore(const char* fmt, ...)
|
void Reporter::FatalErrorWithCore(const char* fmt, ...)
|
||||||
|
@ -393,4 +397,3 @@ void Reporter::DoLog(const char* prefix, EventHandlerPtr event, FILE* out,
|
||||||
if ( alloced )
|
if ( alloced )
|
||||||
free(alloced);
|
free(alloced);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue