pike.git / src / program.c

version» Context lines:

pike.git/src/program.c:10754:    params[0] = buf[0];    }    if (instr->flags & I_HASARG2) {    params[1] = buf[1];    }    sprintf(buf[2], "# %s", instr->name);    string_builder_append_disassembly(s, (size_t)addr, addr, addr,    buf[2], params, NULL);   }    + PMOD_EXPORT void string_builder_append_comment(struct string_builder *s, +  const PIKE_OPCODE_T *addr, +  const char *comment) + { +  while (comment && comment[0]) { +  const char *ptr = strchr(comment, '\n'); +  ptrdiff_t bytes; +  if (ptr) { +  bytes = ptr - comment; +  } else { +  bytes = strlen(comment); +  } +  if (addr) { +  string_builder_sprintf(s, "0x%016lx%*s# %*s\n", +  addr, +  15, "", +  bytes, comment); +  addr = NULL; +  } else { +  string_builder_sprintf(s, "%*s# %*s\n", +  addr, +  33, "", +  bytes, comment); +  } +  comment += bytes + 1; +  } + } +    PMOD_EXPORT void add_reverse_symbol(struct pike_string *sym, void *addr)   {    struct svalue key;    struct svalue val;    SET_SVAL(key, PIKE_T_INT, NUMBER_NUMBER, integer, (ptrdiff_t)addr);    SET_SVAL(val, PIKE_T_STRING, 0, string, sym);    low_mapping_insert(reverse_symbol_table, &key, &val, 1);   }      PMOD_EXPORT void simple_add_reverse_symbol(const char *sym, void *addr)