Branch: Tag:

2019-08-04

2019-08-04 10:30:54 by Henrik Grubbström (Grubba) <grubba@grubba.org>

decode_value: Some initial disassembly-style output.

3021:    case TAG_DELAYED:    EDB (2, fprintf(stderr, "%*sDecoding delay encoded from <%ld>\n",    data->depth, "", num);); +  EDB(1, DECODE_WERR(".tag delayed, %ld", num));    SET_SVAL(entry_id, T_INT, NUMBER_NUMBER, integer, num);    if (!(delayed_enc_val = low_mapping_lookup (data->decoded, &entry_id)))    decode_error (data, NULL, "Failed to find previous record of "
3031:    case TAG_AGAIN:    EDB (1, fprintf(stderr, "%*sDecoding TAG_AGAIN from <%ld>\n",    data->depth, "", num);); +  EDB(1, DECODE_WERR(".tag again, %ld", num));    SET_SVAL(entry_id, T_INT, NUMBER_NUMBER, integer, num);    if((tmp2=low_mapping_lookup(data->decoded, &entry_id)))    {
3050:    EDB (2, fprintf(stderr, "%*sDecoding to <%ld>: TAG%d (%ld)\n",    data->depth, "", entry_id.u.integer,    what & TAG_MASK, num);); +  EDB(1, { +  ptrdiff_t save_ptr = data->ptr; +  data->ptr = data->debug_ptr; +  DECODE_WERR("# Decoding to tag #%ld", entry_id.u.integer); +  data->ptr = save_ptr; +  });    /* Types are added to the encoded mapping AFTER they have been    * encoded. */    delayed_enc_val = NULL;
4617:    return 0;    }    +  EDB(1, { +  string_builder_append_disassembly(data->debug_buf, +  data->debug_ptr, +  data->data + data->debug_ptr, +  data->data + data->ptr, +  ".format 0", +  NULL, +  "Encoding #0."); +  data->debug_ptr = data->ptr; +  }); +     data->decoded=allocate_mapping(128);       add_ref (data->data_str);