Make "REPORT_DISSECTOR_BUG()" (and the macros that use it) call

"abort()" if the ETHEREAL_ABORT_ON_DISSECTOR_BUG environment variable is
set; this is for debugging purposes, to make it easier to get a stack
trace of the offending call.

svn path=/trunk/; revision=16013
This commit is contained in:
Guy Harris 2005-09-26 20:34:13 +00:00
parent 875fb98655
commit 92cc6da06c
1 changed files with 6 additions and 1 deletions

View File

@ -87,10 +87,15 @@ typedef struct _protocol protocol_t;
* That string should be allocated with g_malloc(); using
* "g_strdup_printf()" would work.
*
* If the ETHEREAL_ABORT_ON_DISSECTOR_BUG environment variable is set,
* it will call abort(), instead, to make it easier to get a stack trace.
*
* @param message string to use as the message
*/
#define REPORT_DISSECTOR_BUG(message) \
(THROW_MESSAGE(DissectorError, message))
((getenv("ETHEREAL_ABORT_ON_DISSECTOR_BUG") != NULL) ? \
abort() : \
THROW_MESSAGE(DissectorError, message))
/** Macro used for assertions in dissectors; it doesn't abort, it just
* throws a DissectorError exception, with the assertion failure