pike.git / src / interpret.c

version» Context lines:

pike.git/src/interpret.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: interpret.c,v 1.363 2005/01/25 18:23:51 grubba Exp $ + || $Id: interpret.c,v 1.364 2005/11/08 12:17:41 grubba Exp $   */      #include "global.h"   #include "interpret.h"   #include "object.h"   #include "program.h"   #include "svalue.h"   #include "array.h"   #include "mapping.h"   #include "pike_error.h"
pike.git/src/interpret.c:313: Inside #if defined(HAVE_COMPUTED_GOTO) || defined(PIKE_USE_MACHINE_CODE)
   SET_INSTR_ADDRESS(F_MULTIPLY, o_multiply);    SET_INSTR_ADDRESS(F_DIVIDE, o_divide);    SET_INSTR_ADDRESS(F_MOD, o_mod);    SET_INSTR_ADDRESS(F_CAST, f_cast);    SET_INSTR_ADDRESS(F_CAST_TO_INT, o_cast_to_int);    SET_INSTR_ADDRESS(F_CAST_TO_STRING, o_cast_to_string);    SET_INSTR_ADDRESS(F_RANGE, o_range2);    SET_INSTR_ADDRESS(F_SSCANF, o_sscanf);   #endif /* PIKE_USE_MACHINE_CODE && !PIKE_DEBUG */    tables_need_init=0; + #ifdef INIT_INTERPRETER_STATE +  INIT_INTERPRETER_STATE(); + #endif    }    }   #endif /* HAVE_COMPUTED_GOTO || PIKE_USE_MACHINE_CODE */   }      /*    * lvalues are stored in two svalues in one of these formats:    * array[index] : { array, index }    * mapping[index] : { mapping, index }    * multiset[index] : { multiset, index }
pike.git/src/interpret.c:1292: Inside #if defined(PIKE_USE_MACHINE_CODE) and #if defined(PIKE_DEBUG)
  #ifdef PIKE_DEBUG   {    if (Pike_interpreter.trace_level > 5 && pc) {    int i;    fprintf(stderr, "Calling code at %p:\n", pc);   #ifdef PIKE_OPCODE_ALIGN    if (((INT32)pc) % PIKE_OPCODE_ALIGN) {    Pike_fatal("Odd offset!\n");    }   #endif /* PIKE_OPCODE_ALIGN */ + #ifdef DISASSEMBLE_CODE +  DISASSEMBLE_CODE(pc, 16*4); + #else /* !DISASSEMBLE_CODE */    for (i=0; i < 16; i+=4) {    fprintf(stderr,    " 0x%08x 0x%08x 0x%08x 0x%08x\n",    ((int *)pc)[i],    ((int *)pc)[i+1],    ((int *)pc)[i+2],    ((int *)pc)[i+3]);    } -  + #endif /* DISASSEMBLE_CODE */    }    return eval_instruction_low(pc);   }      static int eval_instruction_low(PIKE_OPCODE_T *pc)   #endif /* PIKE_DEBUG */   {    if(pc == NULL) {       if(do_inter_return_label != NULL)
pike.git/src/interpret.c:2164:    }    else {    dynamic_buffer save_buf;    char *s;    fprintf (stderr, "There's no master to handle the error. Dumping it raw:\n");    init_buf(&save_buf);    describe_svalue (Pike_sp - 1, 0, 0);    s=simple_free_buf(&save_buf);    fprintf(stderr,"%s\n",s);    free(s); +  if (Pike_sp[-1].type == PIKE_T_OBJECT && Pike_sp[-1].u.object->prog) { +  int fun = find_identifier("backtrace", Pike_sp[-1].u.object->prog); +  if (fun != -1) { +  fprintf(stderr, "Attempting to extract the backtrace.\n"); +  safe_apply_low2(Pike_sp[-1].u.object, fun, 0, 0); +  init_buf(&save_buf); +  describe_svalue(Pike_sp - 1, 0, 0); +  pop_stack(); +  s=simple_free_buf(&save_buf); +  fprintf(stderr,"%s\n",s); +  free(s);    } -  +  } +  }       pop_stack();    Pike_interpreter.svalue_stack_margin = SVALUE_STACK_MARGIN;    Pike_interpreter.c_stack_margin = C_STACK_MARGIN;    Pike_interpreter.trace_level = old_t_flag;    }       else {    free_svalue(&throw_value);    throw_value.type=T_INT;