pike.git / src / program.c

version» Context lines:

pike.git/src/program.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: program.c,v 1.316 2003/01/29 15:55:26 mast Exp $"); + RCSID("$Id: program.c,v 1.317 2003/03/19 18:31:34 mast Exp $");   #include "program.h"   #include "object.h"   #include "dynamic_buffer.h"   #include "pike_types.h"   #include "stralloc.h"   #include "las.h"   #include "language.h"   #include "lex.h"   #include "pike_macros.h"   #include "fsort.h"
pike.git/src/program.c:3436:   }      /*    * return the file in which we were executing.    * pc should be the program counter, prog the current    * program, and line will be initialized to the line    * in that file.    */   PMOD_EXPORT char *get_line(unsigned char *pc,struct program *prog,INT32 *linep)   { -  static char *file, *cnt; +  static char *base, *file, *cnt;    static INT32 off,line,pid;    ptrdiff_t offset;       if (prog == 0) return "Unkown program";    offset = pc - prog->program;       if(prog == Pike_compiler->new_program)    {    linep[0]=0;    return "Optimizer";    }    -  if(prog->id != pid || offset < off) +  if(base != prog->linenumbers || prog->id != pid || offset < off)    { -  cnt=prog->linenumbers; +  base = cnt = prog->linenumbers;    off=line=0;    file="Line not found";    pid=prog->id;    }else{    if (cnt < prog->linenumbers + prog->num_linenumbers)    goto fromold;    }       if ((offset > (ptrdiff_t)prog->num_program) || (offset < 0))    return file;