pike.git / src / program.c

version» Context lines:

pike.git/src/program.c:4084:       fprintf(stderr, "\n"    "%*sLinenumber table:\n",    indent, "");    {    INT32 off = 0;    INT_TYPE line = 0;    char *cnt = p->linenumbers;       while (cnt < p->linenumbers + p->num_linenumbers) { -  if (*cnt == 127) { +  while (*cnt == 127) {    int strno;    cnt++;    strno = get_small_number(&cnt); -  +  if (strno >= 0) {    fprintf(stderr, "%*s Filename: String #%d\n", indent, "", strno); -  +  } else { +  int offset = ~strno; +  int kind = *(cnt++); +  strno = (kind >= 0)?get_small_number(&cnt):0; +  switch(kind) { +  case -1: /* end */ +  fprintf(stderr, "%*s Variable #%d end\n", indent, "", offset); +  break; +  case 0: /* name */ +  fprintf(stderr, "%*s Variable #%d name: string #%d\n", +  indent, "", offset, strno); +  break; +  case 1: /* type */ +  fprintf(stderr, "%*s Variable #%d type: constant #%d\n", +  indent, "", offset, strno); +  break; +  default: +  fprintf(stderr, "%*s Variable #%d unknown (%d): value: %d\n", +  indent, "", offset, kind, strno); +  break;    } -  +  } +  if (cnt >= p->linenumbers + p->num_linenumbers) break; +  } +  if (cnt >= p->linenumbers + p->num_linenumbers) break;    off += get_small_number(&cnt);    line += get_small_number(&cnt);    fprintf(stderr, "%*s %8d:%8ld\n", indent, "", off, (long)line);    }    }       fprintf(stderr, "\n");   }      void check_program(struct program *p)
pike.git/src/program.c:8414: Inside #if defined(PIKE_DEBUG)
   (INT32) PIKE_PC);    fprintf(stderr, " last_line:%ld last_file:\"%s\"\n",    (long)Pike_compiler->last_line,    Pike_compiler->last_file?Pike_compiler->last_file->str:"");    }       while(cnt < Pike_compiler->new_program->linenumbers +    Pike_compiler->new_program->num_linenumbers)    {    char *start = cnt; -  if(*cnt == 127) +  while(*cnt == 127)    {    int strno;    cnt++;    strno = get_small_number(&cnt); -  +  if (strno >= 0) {    CHECK_FILE_ENTRY (Pike_compiler->new_program, strno);    if (a_flag > 100) {    file = Pike_compiler->new_program->strings[strno];    fprintf(stderr, "Filename entry:\n"    " len: %"PRINTSIZET"d, shift: %d\n",    file->len, file->size_shift);    } -  +  } else { +  int offset = ~strno; +  int kind = *(cnt++); +  strno = (kind < 0)?-1:get_small_number(&cnt); +  if (a_flag > 100) { +  switch(kind) { +  case -1: /* end */ +  fprintf(stderr, "Variable end entry:\n" +  " offset: 0x%04x\n", offset); +  break; +  case 0: /* name */ +  { +  struct pike_string *var_name = +  Pike_compiler->new_program->strings[strno]; +  fprintf(stderr, "Variable name entry:\n" +  " offset: 0x%04x name: \"%.*s\"\n", +  offset, (int)var_name->len, var_name->str); +  break;    } -  +  case 1: /* type */ +  fprintf(stderr, "Variable type entry:\n" +  " offset: 0x%04x Type constant #%d\n", +  offset, strno); +  break; +  default: +  fprintf(stderr, "Unknown entry #%d\n" +  " offset: 0x%04x Number: 0x%08x\n", +  kind, offset, (kind > 0)?strno:0); +  break; +  } +  } +  } +  if (cnt >= Pike_compiler->new_program->linenumbers + +  Pike_compiler->new_program->num_linenumbers) break; +  } +  if (cnt >= Pike_compiler->new_program->linenumbers + +  Pike_compiler->new_program->num_linenumbers) break;    off+=get_small_number(&cnt);    line+=get_small_number(&cnt);    if (a_flag > 100) {    fprintf(stderr, " off: %d, line: %ld\n"    " raw: ",    off, (long)line);    for (;start < cnt; start++) {    fprintf(stderr, "%02x ", *((unsigned char *)start));    }    fprintf(stderr, "\n");