diff options
author | Guy Harris <guy@alum.mit.edu> | 2005-09-26 20:34:13 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2005-09-26 20:34:13 +0000 |
commit | 92cc6da06c990a1f32bcee00e980e07d7515ad4d (patch) | |
tree | 0d5d98b706509e2b475fe998b0146ee56f9063a6 /epan/proto.h | |
parent | 875fb98655c021fa1759afedb97d7f7708e792b2 (diff) |
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
Diffstat (limited to 'epan/proto.h')
-rw-r--r-- | epan/proto.h | 7 |
1 files changed, 6 insertions, 1 deletions
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 |