pike.git / src / error.c

version» Context lines:

pike.git/src/error.c:1:   /*\   ||| This file a part of Pike, and is copyright by Fredrik Hubinette   ||| Pike is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/   /**/   #define NO_PIKE_SHORTHAND   #include "global.h"   #include "pike_macros.h" - #include "error.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.64 2000/12/01 01:14:56 hubbe Exp $"); + RCSID("$Id: error.c,v 1.65 2000/12/01 08:09:46 hubbe Exp $");      #undef ATTRIBUTE   #define ATTRIBUTE(X)      /*    * Backtrace handling.    */      struct pike_backtrace   {
pike.git/src/error.c:270:    while(Pike_interpreter.recoveries->onerror)    {    (*Pike_interpreter.recoveries->onerror->func)(Pike_interpreter.recoveries->onerror->arg);    Pike_interpreter.recoveries->onerror=Pike_interpreter.recoveries->onerror->previous;    }       Pike_interpreter.recoveries=Pike_interpreter.recoveries->previous;    }       if(!Pike_interpreter.recoveries) -  fatal("No error recovery context.\n"); +  fatal("No Pike_error recovery context.\n");      #ifdef PIKE_DEBUG    if(Pike_sp - Pike_interpreter.evaluator_stack < Pike_interpreter.recoveries->stack_pointer) -  fatal("Stack error in error.\n"); +  fatal("Stack Pike_error in Pike_error.\n");   #endif       while(Pike_fp != Pike_interpreter.recoveries->frame_pointer)    {   #ifdef PIKE_DEBUG    if(!Pike_fp)    fatal("Popped out of stack frames.\n");   #endif    POP_PIKE_FRAME();    }
pike.git/src/error.c:330:    * Check sizes of arguments passed!    */   void DECLSPEC(noreturn) va_error(const char *fmt, va_list args) ATTRIBUTE((noreturn))   {    char buf[4096];    SWAP_IN_THREAD_IF_REQUIRED();    if(in_error)    {    const char *tmp=in_error;    in_error=0; -  fatal("Recursive error() calls, original error: %s",tmp); +  fatal("Recursive Pike_error() calls, original Pike_error: %s",tmp);    }       in_error=buf;      #ifdef HAVE_VSNPRINTF    vsnprintf(buf, 4090, fmt, args);   #else /* !HAVE_VSNPRINTF */    VSPRINTF(buf, fmt, args);   #endif /* HAVE_VSNPRINTF */       if(!Pike_interpreter.recoveries)    {   #ifdef PIKE_DEBUG    dump_backlog();   #endif    -  fprintf(stderr,"No error recovery context!\n%s",buf); +  fprintf(stderr,"No Pike_error recovery context!\n%s",buf);    exit(99);    }       if((size_t)strlen(buf) >= (size_t)sizeof(buf)) -  fatal("Buffer overflow in error()\n"); +  fatal("Buffer overflow in Pike_error()\n");       low_error(buf);   }      PMOD_EXPORT DECLSPEC(noreturn) void new_error(const char *name, const char *text, struct svalue *oldsp,    INT32 args, const char *file, int line) ATTRIBUTE((noreturn))   {    int i;       ASSERT_THREAD_SWAPPED_IN();       if(in_error)    {    const char *tmp=in_error;    in_error=0; -  fatal("Recursive error() calls, original error: %s",tmp); +  fatal("Recursive Pike_error() calls, original Pike_error: %s",tmp);    }       in_error=text;       if(!Pike_interpreter.recoveries)    {   #ifdef PIKE_DEBUG    dump_backlog();   #endif    -  fprintf(stderr,"No error recovery context!\n%s():%s",name,text); +  fprintf(stderr,"No Pike_error recovery context!\n%s():%s",name,text);    if(file)    fprintf(stderr,"at %s:%d\n",file,line);    exit(99);    }       push_text(text);       f_backtrace(0);       if (file) {
pike.git/src/error.c:431:    d_flag=0;       fprintf(stderr,"%s\n",(char *)msg);   #ifdef PIKE_DEBUG    dump_backlog();   #endif    fprintf(stderr,"%s\n",(char *)msg);   #ifdef PIKE_DEBUG    {    char *s; -  fprintf(stderr,"Attempting to dump raw error: (may fail)\n"); +  fprintf(stderr,"Attempting to dump raw Pike_error: (may fail)\n");    init_buf();    describe_svalue(&throw_value,0,0);    s=simple_free_buf();    fprintf(stderr,"%s\n",s);    free(s);    }   #endif    exit(1);   }   
pike.git/src/error.c:464:      PMOD_EXPORT void fatal_on_error(void *msg)   {   #ifdef PIKE_DEBUG    dump_backlog();   #endif    fprintf(stderr,"%s\n",(char *)msg);    do_abort();   }    - PMOD_EXPORT DECLSPEC(noreturn) void error(const char *fmt,...) ATTRIBUTE((noreturn,format (printf, 1, 2))) + PMOD_EXPORT DECLSPEC(noreturn) void Pike_error(const char *fmt,...) ATTRIBUTE((noreturn,format (printf, 1, 2)))   {    va_list args;    va_start(args,fmt);    va_error(fmt,args);    va_end(args);   }      PMOD_EXPORT DECLSPEC(noreturn) void debug_fatal(const char *fmt, ...) ATTRIBUTE((noreturn,format (printf, 1, 2)))   {    va_list args;
pike.git/src/error.c:525: Inside #if 1
     #if 1      #define ERR_DECLARE   #include "errors.h"         void f_error_cast(INT32 args)   {    char *s; -  get_all_args("error->cast",args,"%s",&s); +  get_all_args("Pike_error->cast",args,"%s",&s);    if(!strncmp(s,"array",5))    {    pop_n_elems(args);    ref_push_string(GENERIC_ERROR_THIS->desc);    ref_push_array(GENERIC_ERROR_THIS->backtrace);    f_aggregate(2);    }else{ -  SIMPLE_BAD_ARG_ERROR("error->cast", 1, "the value \"array\""); +  SIMPLE_BAD_ARG_ERROR("Pike_error->cast", 1, "the value \"array\"");    }   }      void f_error_index(INT32 args)   {    INT_TYPE ind; -  get_all_args("error->`[]",args,"%i",&ind); +  get_all_args("Pike_error->`[]",args,"%i",&ind);       switch(ind)    {    case 0:    pop_n_elems(args);    ref_push_string(GENERIC_ERROR_THIS->desc);    break;    case 1:    pop_n_elems(args);    ref_push_array(GENERIC_ERROR_THIS->backtrace);    break;    default: -  index_error("error->`[]", Pike_sp-args, args, NULL, Pike_sp-args, +  index_error("Pike_error->`[]", Pike_sp-args, args, NULL, Pike_sp-args,    "Index %d is out of range 0 - 1.\n", ind);    break;    }   }         void f_error_describe(INT32 args)   {    pop_n_elems(args);    ref_push_object(Pike_fp->current_object);
pike.git/src/error.c:585:   #else /* !ERROR_DEBUG */   #define DWERROR(X)   #endif /* ERROR_DEBUG */      #define INIT_ERROR(FEL)\    va_list foo; \    struct object *o; \    va_start(foo,desc); \    ASSERT_THREAD_SWAPPED_IN(); \    o=low_clone(PIKE_CONCAT(FEL,_error_program)); \ -  DWERROR((stderr, "%s(): Throwing a " #FEL " error\n", func)) +  DWERROR((stderr, "%s(): Throwing a " #FEL " Pike_error\n", func))      #define ERROR_DONE(FOO) \    PIKE_CONCAT(FOO,_error_va(o,func, \    base_sp, args, \    desc,foo)); \    va_end(foo)      #define ERROR_STRUCT(STRUCT,O) \    ((struct PIKE_CONCAT(STRUCT,_error_struct) *)((O)->storage + PIKE_CONCAT(STRUCT,_error_offset)))   
pike.git/src/error.c:635: Inside #if defined(HAVE_VSNPRINTF)
     #ifdef HAVE_VSNPRINTF    vsnprintf(buf, sizeof(buf)-1, fmt, foo);   #else /* !HAVE_VSNPRINTF */    /* Sentinel that will be overwritten on buffer overflow. */    buf[sizeof(buf)-1] = '\0';       VSPRINTF(buf, fmt, foo);       if(buf[sizeof(buf)-1]) -  fatal("Buffer overflow in error()\n"); +  fatal("Buffer overflow in Pike_error()\n");   #endif /* HAVE_VSNPRINTF */    in_error=buf;       if (!master_program) {    fprintf(stderr, "ERROR: %s\n", buf);    }       ERROR_STRUCT(generic,o)->desc=make_shared_string(buf);    f_backtrace(0);