diff options
author | nijtmans <nijtmans> | 2010-12-13 13:57:58 (GMT) |
---|---|---|
committer | nijtmans <nijtmans> | 2010-12-13 13:57:58 (GMT) |
commit | b8aefcc068ba0ea1d0259b9321757135e1315167 (patch) | |
tree | 30ca1b28ea6a5faf5f439edcb9d87fb9e08fef81 /generic/tclPanic.c | |
parent | 15b3fd3efd468b197e322191cb62d25baf556ab0 (diff) | |
download | tcl-b8aefcc068ba0ea1d0259b9321757135e1315167.zip tcl-b8aefcc068ba0ea1d0259b9321757135e1315167.tar.gz tcl-b8aefcc068ba0ea1d0259b9321757135e1315167.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 - } } /* |