pike.git / src / error.c

version» Context lines:

pike.git/src/error.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: error.c,v 1.99 2003/07/21 23:35:27 mast Exp $ + || $Id: error.c,v 1.100 2004/02/09 18:49:16 mast Exp $   */      #define NO_PIKE_SHORTHAND   #include "global.h"   #include "svalue.h"   #include "pike_macros.h"   #include "pike_error.h"   #include "interpret.h"   #include "stralloc.h"   #include "builtin_functions.h"   #include "array.h"   #include "object.h"   #include "main.h"   #include "builtin_functions.h"   #include "backend.h"   #include "operators.h"   #include "module_support.h"   #include "threads.h"   #include "gc.h"    - RCSID("$Id: error.c,v 1.99 2003/07/21 23:35:27 mast Exp $"); + RCSID("$Id: error.c,v 1.100 2004/02/09 18:49:16 mast Exp $");      #undef ATTRIBUTE   #define ATTRIBUTE(X)      PMOD_EXPORT const char msg_fatal_error[] =    "%s:%d: Fatal error:\n";   #ifdef PIKE_DEBUG   PMOD_EXPORT const char msg_unsetjmp_nosync_1[] =    "UNSETJMP out of sync! (last SETJMP at %s)!\n";   PMOD_EXPORT const char msg_unsetjmp_nosync_2[] =
pike.git/src/error.c:390:    if(Pike_in_gc)    fprintf(stderr,"Pike was in GC stage %d when this fatal occured:\n",Pike_in_gc);    Pike_in_gc = GC_PASS_DISABLED;       (void)VFPRINTF(stderr, fmt, args);       d_flag=t_flag=0;    if(Pike_sp && Pike_interpreter.evaluator_stack &&    master_object && master_object->prog)    { +  JMP_BUF jmp; +  struct callback_list saved_eval_cbs = evaluator_callbacks; +  /* Don't want thread switches or any other evaluator stuff while +  * we let the master describe the backtrace below. */ +  low_init_threads_disable(); +  MEMSET (&evaluator_callbacks, 0, sizeof (evaluator_callbacks)); +  if (SETJMP (jmp)) +  fprintf(stderr,"Got exception when trying to describe backtrace.\n"); +  else { +  jmp.severity = THROW_EXIT; /* Don't want normal exit code to run here. */    push_error("Backtrace at time of fatal:\n");    APPLY_MASTER("describe_backtrace",1);    if(Pike_sp[-1].type==PIKE_T_STRING)    write_to_stderr(Pike_sp[-1].u.string->str, Pike_sp[-1].u.string->len); -  +  } +  UNSETJMP (jmp); +  exit_threads_disable (NULL); +  evaluator_callbacks = saved_eval_cbs;    }else{    fprintf(stderr,"No stack - no backtrace.\n");    }    fflush(stderr);    do_abort();   }      #if 1      /*! @class Error