diff options
| author | nijtmans <nijtmans> | 2010-12-13 13:57:58 (GMT) |
|---|---|---|
| committer | nijtmans <nijtmans> | 2010-12-13 13:57:58 (GMT) |
| commit | 1c0db6f4ed767a751ca3f978bbae9f64f0168503 (patch) | |
| tree | 30ca1b28ea6a5faf5f439edcb9d87fb9e08fef81 /generic/tclPanic.c | |
| parent | 981031323476640c52e161a2db4c8b734c034a7a (diff) | |
| download | tcl-1c0db6f4ed767a751ca3f978bbae9f64f0168503.zip tcl-1c0db6f4ed767a751ca3f978bbae9f64f0168503.tar.gz tcl-1c0db6f4ed767a751ca3f978bbae9f64f0168503.tar.bz2 | |
Use gcc's __builtin_trap(), when available, to enter the debugger after a panic.
Undocumented feature, see [Patch 3124554]: Move WishPanic from Tk to Tcl.
Diffstat (limited to 'generic/tclPanic.c')
| -rw-r--r-- | generic/tclPanic.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/generic/tclPanic.c b/generic/tclPanic.c index 9aa0627..73059a0 100644 --- a/generic/tclPanic.c +++ b/generic/tclPanic.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclPanic.c,v 1.15 2010/12/01 10:43:36 nijtmans Exp $ + * RCS: @(#) $Id: tclPanic.c,v 1.16 2010/12/13 13:57:58 nijtmans Exp $ */ #include "tclInt.h" @@ -90,13 +90,19 @@ Tcl_PanicVA( arg8); fprintf(stderr, "\n"); fflush(stderr); + } + /* In case the users panic proc does not abort, we do it here */ +#ifdef __GNUC__ + __builtin_trap(); +#endif #ifdef _WIN32 - DebugBreak(); +# ifdef _MSC_VER + DebugBreak(); +# endif ExitProcess(1); #else - abort(); + abort(); #endif - } } /* |
