Win32: call an existing debugger if a DissectorError is thrown. This preserves the call stack of the bug making debugging much easier.
This can't be done in every error throwing case, as e.g. throwing a ReportedBoundsError might happen a lot even if no bugs are involved. Anyway, extending this to other errors can be done manually while debugging. svn path=/trunk/; revision=17072
This commit is contained in:
parent
35dd233580
commit
6f2c4c84c1
|
@ -33,6 +33,13 @@
|
|||
#include <limits.h>
|
||||
#include "except.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
/* IsDebuggerPresent() needs this #define! */
|
||||
#define _WIN32_WINNT 0x0400
|
||||
#include <windows.h>
|
||||
#include "exceptions.h"
|
||||
#endif
|
||||
|
||||
#define XCEPT_BUFFER_SIZE 1024
|
||||
|
||||
#ifdef KAZLIB_RCSID
|
||||
|
@ -268,6 +275,12 @@ void except_throw(long group, long code, const char *msg)
|
|||
except.except_message = msg;
|
||||
except.except_dyndata = 0;
|
||||
|
||||
#ifdef _WIN32
|
||||
if (code == DissectorError && IsDebuggerPresent()) {
|
||||
DebugBreak();
|
||||
}
|
||||
#endif
|
||||
|
||||
do_throw(&except);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue