pike.git / src / interpret.c

version» Context lines:

pike.git/src/interpret.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.   \*/   /**/   #include "global.h" - RCSID("$Id: interpret.c,v 1.148 2000/04/25 09:32:46 hubbe Exp $"); + RCSID("$Id: interpret.c,v 1.149 2000/04/27 02:12:30 hubbe Exp $");   #include "interpret.h"   #include "object.h"   #include "program.h"   #include "svalue.h"   #include "array.h"   #include "mapping.h"   #include "error.h"   #include "language.h"   #include "stralloc.h"   #include "constants.h"
pike.git/src/interpret.c:494: Inside #if defined(_REENTRANT)
  #ifdef _REENTRANT    struct object *thread_id;   #endif   };      struct backlog backlog[BACKLOG];   int backlogp=BACKLOG-1;      void dump_backlog(void)   { + #ifdef _REENTRANT +  struct object *thread=0; + #endif +     int e;    if(!d_flag || backlogp<0 || backlogp>=BACKLOG)    return;       e=backlogp;    do    {    e++;    if(e>=BACKLOG) e=0;       if(backlog[e].program)    {    char *file;    INT32 line;    -  + #ifdef _REENTRANT +  if(thread != backlog[e].thread_id) +  { +  fprintf(stderr,"[Thread swap, thread_id=%p]\n",backlog[e].thread_id); +  thread = backlog[e].thread_id; +  } + #endif +     file=get_line(backlog[e].pc-1,backlog[e].program, &line);    if(backlog[e].instruction < 0 || backlog[e].instruction+F_OFFSET > F_MAX_OPCODE)    { -  fprintf(stderr,"%s:%ld: %p ILLEGAL INSTRUCTION %d\n", +  fprintf(stderr,"%s:%ld: ILLEGAL INSTRUCTION %d\n",    file,    (long)line, - #ifdef _REENTRANT -  backlog[e].thread_id, - #else -  0, - #endif +     backlog[e].instruction + F_OFFSET);    continue;    }          if(instrs[backlog[e].instruction].flags & I_HASARG2)    { -  fprintf(stderr,"%s:%ld: %p %s(%ld,%ld)\n", +  fprintf(stderr,"%s:%ld: %s(%ld,%ld)\n",    file,    (long)line, - #ifdef _REENTRANT -  backlog[e].thread_id, - #else -  0, - #endif +     low_get_f_name(backlog[e].instruction + F_OFFSET, backlog[e].program),    (long)backlog[e].arg,    (long)backlog[e].arg2);    }    else if(instrs[backlog[e].instruction].flags & I_HASARG)    { -  fprintf(stderr,"%s:%ld: %p %s(%ld)\n", +  fprintf(stderr,"%s:%ld: %s(%ld)\n",    file,    (long)line, - #ifdef _REENTRANT -  backlog[e].thread_id, - #else -  0, - #endif +     low_get_f_name(backlog[e].instruction + F_OFFSET, backlog[e].program),    (long)backlog[e].arg);    }else{ -  fprintf(stderr,"%s:%ld: %p %s\n", +  fprintf(stderr,"%s:%ld: %s\n",    file,    (long)line, - #ifdef _REENTRANT -  backlog[e].thread_id, - #else -  0, - #endif +     low_get_f_name(backlog[e].instruction + F_OFFSET, backlog[e].program));    }    }    }while(e!=backlogp);   }      #endif   static int o_catch(unsigned char *pc);      #ifdef PIKE_DEBUG