pike.git / src / error.c

version» Context lines:

pike.git/src/error.c:14:   #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.61 2000/08/15 16:55:20 grubba Exp $"); + RCSID("$Id: error.c,v 1.62 2000/08/21 21:32:37 grubba Exp $");      #undef ATTRIBUTE   #define ATTRIBUTE(X)      /*    * Backtrace handling.    */      struct pike_backtrace   {
pike.git/src/error.c:256:    r->stack_pointer=Pike_sp-Pike_interpreter.evaluator_stack;    r->mark_sp=Pike_mark_sp - Pike_interpreter.mark_stack;    r->previous=Pike_interpreter.recoveries;    r->onerror=0;    r->severity=THROW_ERROR;    Pike_interpreter.recoveries=r;    check_recovery_context();    return r;   }    - PMOD_EXPORT void pike_throw(void) ATTRIBUTE((noreturn)) + PMOD_EXPORT DECLSPEC(noreturn) void pike_throw(void) ATTRIBUTE((noreturn))   {    while(Pike_interpreter.recoveries && throw_severity > Pike_interpreter.recoveries->severity)    {    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;
pike.git/src/error.c:309:   {    push_text(description);    f_backtrace(0);    f_aggregate(2);   }      struct svalue throw_value = { PIKE_T_INT };   int throw_severity;   static const char *in_error;    - PMOD_EXPORT void low_error(char *buf) ATTRIBUTE((noreturn)) + PMOD_EXPORT DECLSPEC(noreturn) void low_error(char *buf) ATTRIBUTE((noreturn))   {    push_error(buf);    free_svalue(& throw_value);    throw_value = *--Pike_sp;    throw_severity = THROW_ERROR;    in_error=0;    pike_throw(); /* Hope someone is catching, or we will be out of balls. */   }      /* FIXME: NOTE: This function uses a static buffer.    * Check sizes of arguments passed!    */ - void va_error(const char *fmt, va_list args) ATTRIBUTE((noreturn)) + 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);    }   
pike.git/src/error.c:357:    fprintf(stderr,"No error recovery context!\n%s",buf);    exit(99);    }       if((size_t)strlen(buf) >= (size_t)sizeof(buf))    fatal("Buffer overflow in error()\n");       low_error(buf);   }    - PMOD_EXPORT void new_error(const char *name, const char *text, struct svalue *oldsp, + 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;
pike.git/src/error.c:451:      PMOD_EXPORT void fatal_on_error(void *msg)   {   #ifdef PIKE_DEBUG    dump_backlog();   #endif    fprintf(stderr,"%s\n",(char *)msg);    abort();   }    - PMOD_EXPORT void error(const char *fmt,...) ATTRIBUTE((noreturn,format (printf, 1, 2))) + PMOD_EXPORT DECLSPEC(noreturn) void 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 void debug_fatal(const char *fmt, ...) ATTRIBUTE((noreturn,format (printf, 1, 2))) + PMOD_EXPORT DECLSPEC(noreturn) void debug_fatal(const char *fmt, ...) ATTRIBUTE((noreturn,format (printf, 1, 2)))   {    va_list args;    static int in_fatal = 0;       va_start(args,fmt);    /* Prevent double fatal. */    if (in_fatal)    {    (void)VFPRINTF(stderr, fmt, args);    abort();
pike.git/src/error.c:601:    ERROR_STRUCT(STRUCT, o)->X.subtype = 0; \    ERROR_STRUCT(STRUCT, o)->X.u.integer = 0; \    } \    } while (0)         #define ERROR_COPY_REF(STRUCT,X) \    add_ref( ERROR_STRUCT(STRUCT,o)->X=X )       - void generic_error_va(struct object *o, + DECLSPEC(noreturn) void generic_error_va(struct object *o,    char *func,    struct svalue *base_sp, int args,    char *fmt,    va_list foo)    ATTRIBUTE((noreturn))   {    char buf[8192];    struct pike_string *desc;    struct array *backtrace;    int i;
pike.git/src/error.c:661:    dmalloc_touch_svalue(Pike_sp);       free_svalue(& throw_value);    throw_value.type=PIKE_T_OBJECT;    throw_value.u.object=o;    throw_severity = THROW_ERROR;    in_error=0;    pike_throw(); /* Hope someone is catching, or we will be out of balls. */   }    - PMOD_EXPORT void generic_error( + PMOD_EXPORT DECLSPEC(noreturn) void generic_error(    char *func,    struct svalue *base_sp, int args,    char *desc, ...) ATTRIBUTE((noreturn,format (printf, 4, 5)))   {    INIT_ERROR(generic);    ERROR_DONE(generic);   }    - PMOD_EXPORT void index_error( + PMOD_EXPORT DECLSPEC(noreturn) void index_error(    char *func,    struct svalue *base_sp, int args,    struct svalue *val,    struct svalue *ind,    char *desc, ...) ATTRIBUTE((noreturn,format (printf, 6, 7)))   {    INIT_ERROR(index);    ERROR_COPY_SVALUE(index, val);    ERROR_COPY_SVALUE(index, ind);    ERROR_DONE(generic);   }    - PMOD_EXPORT void bad_arg_error( + PMOD_EXPORT DECLSPEC(noreturn) void bad_arg_error(    char *func,    struct svalue *base_sp, int args,    int which_arg,    char *expected_type,    struct svalue *got,    char *desc, ...) ATTRIBUTE((noreturn,format (printf, 7, 8)))   {    INIT_ERROR(bad_arg);    ERROR_COPY(bad_arg, which_arg);    ERROR_STRUCT(bad_arg,o)->expected_type=make_shared_string(expected_type);
pike.git/src/error.c:707:    }else{    ERROR_STRUCT(bad_arg,o)->got.type=PIKE_T_INT;    ERROR_STRUCT(bad_arg,o)->got.subtype=NUMBER_UNDEFINED;    ERROR_STRUCT(bad_arg,o)->got.u.integer=0;    }    DWERROR((stderr, "%s():Bad arg %d (expected %s)\n",    func, which_arg, expected_type));    ERROR_DONE(generic);   }    - PMOD_EXPORT void math_error( + PMOD_EXPORT DECLSPEC(noreturn) void math_error(    char *func,    struct svalue *base_sp, int args,    struct svalue *number,    char *desc, ...) ATTRIBUTE((noreturn,format (printf, 5, 6)))   {    INIT_ERROR(math);    if(number)    {    ERROR_COPY_SVALUE(math, number);    }else{    ERROR_STRUCT(math,o)->number.type=PIKE_T_INT;    ERROR_STRUCT(math,o)->number.subtype=NUMBER_UNDEFINED;    ERROR_STRUCT(math,o)->number.u.integer=0;    }    ERROR_DONE(generic);   }    - PMOD_EXPORT void resource_error( + PMOD_EXPORT DECLSPEC(noreturn) void resource_error(    char *func,    struct svalue *base_sp, int args,    char *resource_type,    size_t howmuch_,    char *desc, ...) ATTRIBUTE((noreturn,format (printf, 6, 7)))   {    INT_TYPE howmuch = DO_NOT_WARN((INT_TYPE)howmuch_);    INIT_ERROR(resource);    ERROR_COPY(resource, howmuch);    ERROR_STRUCT(resource,o)->resource_type=make_shared_string(resource_type);    ERROR_DONE(generic);   }    - PMOD_EXPORT void permission_error( + PMOD_EXPORT DECLSPEC(noreturn) void permission_error(    char *func,    struct svalue *base_sp, int args,    char *permission_type,    char *desc, ...) ATTRIBUTE((noreturn, format(printf, 5, 6)))   {    INIT_ERROR(permission);    ERROR_STRUCT(permission,o)->permission_type=    make_shared_string(permission_type);    ERROR_DONE(generic);   }