error: add --enable-panic-abort config options

For debugging purposes, make it possible to force calling abort() on
ERR_PANIC.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
This commit is contained in:
H. Peter Anvin 2017-12-20 12:06:54 -08:00
parent 7a6bf74d02
commit dcbaf677d4
2 changed files with 10 additions and 1 deletions

View File

@ -1829,7 +1829,9 @@ static void nasm_verror_common(int severity, const char *fmt, va_list args)
break; /* placate silly compilers */
case ERR_PANIC:
fflush(NULL);
/* abort(); */ /* halt, catch fire, and dump core */
#ifdef ABORT_ON_PANIC
abort(); /* halt, catch fire, dump core/stop debugger */
#endif
if (ofile) {
fclose(ofile);
remove(outname);

View File

@ -43,6 +43,13 @@ AS_IF([test x"$pa_init_cflags" = x],
AS_IF([test x"$pa_optimize" = "x-O0"],
[PA_ADD_CFLAGS([-fno-omit-frame-pointer])])
dnl Abort on panic
PA_ARG_ENABLED([panic-abort],
[call abort() on panic to trap in the debugger],
[AC_DEFINE(ABORT_ON_PANIC)])
AH_TEMPLATE(ABORT_ON_PANIC,
[Define to 1 to call abort() on panics (internal errors), for debugging.])
dnl Check for library extension
PA_LIBEXT