pike.git / src / program.c

version» Context lines:

pike.git/src/program.c:8174:   /*    * Line number support routines, now also tells what file we are in.    */      /* program.linenumbers format:    *    * Filename entry:    * 1. char 127 (marker).    * 2. small number Filename entry number in string table.    * +  * Frame variable: +  * 1. char 127 (marker). +  * 2. small number ~(frame stack offset). +  * 3. char 0: name, 1: type +  * 4. small number name: strings_offset, type: constants_offset +  *    * Line number entry:    * 1. small number Index in program.program (pc).    * Stored as the difference from the pc in the    * closest previous line number entry. The first    * stored entry is absolute.    * 2. small number Line number. Stored in the same way as the pc.    *    * Small number:    * If -127 < n < 127:    * 1. char The number.
pike.git/src/program.c:8445:    insert_small_number(store_prog_string(current_file));    copy_shared_string(Pike_compiler->last_file, current_file);    }    insert_small_number((INT32)(PIKE_PC-Pike_compiler->last_pc));    insert_small_number(current_line-Pike_compiler->last_line);    Pike_compiler->last_line = current_line;    Pike_compiler->last_pc = (INT32)PIKE_PC;    }   }    + void store_linenumber_frame_name(int frame_offset, int string_num) + { +  add_to_linenumbers(127); +  insert_small_number(~frame_offset); +  add_to_linenumbers(0); +  insert_small_number(string_num); + } +  + void store_linenumber_frame_type(int frame_offset, int constant_num) + { +  add_to_linenumbers(127); +  insert_small_number(~frame_offset); +  add_to_linenumbers(1); +  insert_small_number(constant_num); + } +    #define FIND_PROGRAM_LINE(prog, file, line) do { \    char *pos = prog->linenumbers; \    file = NULL; \    \    if (pos < prog->linenumbers + prog->num_linenumbers) { \    if (*pos == 127) { \    int strno; \    pos++; \    strno = get_small_number(&pos); \    CHECK_FILE_ENTRY (prog, strno); \
pike.git/src/program.c:8630:    pid=prog->id;    file = 0;       while(cnt < prog->linenumbers + prog->num_linenumbers)    {    if(*cnt == 127)    {    int strno;    cnt++;    strno = get_small_number(&cnt); +  if (strno >= 0) {    CHECK_FILE_ENTRY (prog, strno);    next_file = prog->strings[strno];    continue; -  +  } else { +  int frame_offset = ~strno; +  int kind = *cnt++; +  strno = get_small_number(&cnt);    } -  +  }    off+=get_small_number(&cnt);    fromold:    if(off > offset) break;    line+=get_small_number(&cnt);    file = next_file;    }    if (cnt >= prog->linenumbers + prog->num_linenumbers) {    /* We reached the end of the table. Make sure    * we get in sync again next time we're called.    */