pike.git / src / program.c

version» Context lines:

pike.git/src/program.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: program.c,v 1.748 2008/08/17 16:22:41 mast Exp $ + || $Id: program.c,v 1.749 2008/08/18 15:18:18 mast Exp $   */      #include "global.h"   #include "program.h"   #include "object.h"   #include "dynamic_buffer.h"   #include "pike_types.h"   #include "stralloc.h"   #include "las.h"   #include "lex.h"
pike.git/src/program.c:6751:   {    struct pike_string *res = low_get_program_line(prog, linep);    if (!res) {    struct pike_string *dash;    REF_MAKE_CONST_STRING(dash, "-");    return dash;    }    return res;   }    - #ifdef PIKE_DEBUG - /* Variant for convenient use from a debugger. */ - void gdb_program_line (struct program *prog) - { -  INT32 line; -  char *file = low_get_program_line_plain (prog, &line, 0); -  fprintf (stderr, "%s:%d\n", file, line); - } - #endif -  +    PMOD_EXPORT struct pike_string *low_get_line (PIKE_OPCODE_T *pc,    struct program *prog, INT32 *linep)   {    linep[0] = 0;       if (prog->program && prog->linenumbers) {    ptrdiff_t offset = pc - prog->program;    if ((offset < (ptrdiff_t)prog->num_program) && (offset >= 0)) {    static char *file = NULL;    static char *base, *cnt;
pike.git/src/program.c:6861:    }    linep[0]=line;       if (file) return make_plain_file (file, len, shift, malloced);    }    }       return NULL;   }    + #ifdef PIKE_DEBUG + /* Variants for convenient use from a debugger. */    -  + void gdb_program_line (struct program *prog) + { +  INT32 line; +  char *file = low_get_program_line_plain (prog, &line, 0); +  fprintf (stderr, "%s:%d\n", file, line); + } +  + void gdb_get_line (PIKE_OPCODE_T *pc, struct program *prog) + { +  INT32 line; +  char *file = low_get_line_plain (pc, prog, &line, 0); +  fprintf (stderr, "%s:%d\n", file, line); + } +  + #endif +    /*    * return the file in which we were executing. pc should be the    * program counter (i.e. the address in prog->program), prog the    * current program, and line will be initialized to the line in that    * file.    */   PMOD_EXPORT struct pike_string *get_line(PIKE_OPCODE_T *pc,    struct program *prog, INT32 *linep)   {    struct pike_string *res;