From 92cc6da06c990a1f32bcee00e980e07d7515ad4d Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Mon, 26 Sep 2005 20:34:13 +0000 Subject: 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 --- epan/proto.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'epan/proto.h') diff --git a/epan/proto.h b/epan/proto.h index edb6b610df..ce2a2b0cc1 100644 --- a/epan/proto.h +++ b/epan/proto.h @@ -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 -- cgit v1.2.3