pike.git / src / error.c

version» Context lines:

pike.git/src/error.c:12:   #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"    - RCSID("$Id: error.c,v 1.39 1999/10/06 15:30:05 grubba Exp $"); + RCSID("$Id: error.c,v 1.40 1999/12/07 01:33:03 grubba Exp $");      #undef ATTRIBUTE   #define ATTRIBUTE(X)      JMP_BUF *recoveries=0;      #ifdef PIKE_DEBUG   void check_recovery_context(void)   {    char foo;
pike.git/src/error.c:108:      struct svalue throw_value = { T_INT };   int throw_severity;   static const char *in_error;      void low_error(char *buf) ATTRIBUTE((noreturn))   {    push_error(buf);    free_svalue(& throw_value);    throw_value = *--sp; -  throw_severity=THROW_ERROR; +  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))   {    char buf[4096];
pike.git/src/error.c:333:    ref_push_object(fp->current_object);    APPLY_MASTER("describe_backtrace",1);   }      void f_error_backtrace(INT32 args)   {    pop_n_elems(args);    ref_push_array(GENERIC_ERROR_THIS->backtrace);   }    + #ifdef ERROR_DEBUG + #define DWERROR(X) fprintf X + #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)); +  o=low_clone(PIKE_CONCAT(FEL,_error_program)); \ +  DWERROR((stderr, "%s(): Throwing a " #FEL " 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:406:    f_aggregate(args + 3);    f_aggregate(1);    f_add(2);    }       if(sp[-1].type!=T_ARRAY)    fatal("Error failed to generate a backtrace!\n");       ERROR_STRUCT(generic,o)->backtrace=sp[-1].u.array;    sp--; +  dmalloc_touch_svalue(sp);       free_svalue(& throw_value);    throw_value.type=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. */   }      void generic_error(
pike.git/src/error.c:456:    ERROR_COPY(bad_arg, which_arg);    ERROR_STRUCT(bad_arg,o)->expected_type=make_shared_string(expected_type);    if(got)    {    ERROR_COPY_SVALUE(bad_arg, got);    }else{    ERROR_STRUCT(bad_arg,o)->got.type=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);   }      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);