diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-07-08 07:10:11 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-07-08 07:24:12 +0900 |
| commit | f16ea05a178a0ffd38a054d28a01c1780d63d03a (patch) | |
| tree | ec1ef57c79004a555a81631600e561ad792c89ea /src/load.c | |
| parent | fb1d4ff6826098c5d44be1cd8500dd4cf97ed57c (diff) | |
| download | mruby-f16ea05a178a0ffd38a054d28a01c1780d63d03a.tar.gz mruby-f16ea05a178a0ffd38a054d28a01c1780d63d03a.zip | |
debug.c: new debug line information format `mrb_debug_line_packed_map`.
It uses BER number compression of delta of instruction positions and line
numbers. BER compression is a variable length number representation.
* `mrb_debug_line_ary`: array of line numbers represented in `uint16_t`.
`[lineno, lineno, ...]`
* `mrb_debug_line_flat_map`: array of `mrb_irep_debug_info_line`, which
is `struct {uint32_t pos; uint16_t lineno}`, for each line.
* `mrb_debug_line_packed_map` [new]: sequence of BER compressed 2
numbers, `pos_delta, lineno_delta`. Deltas are differences from
previous values (starting `0`). `line_entry_counts` represents total
length of a packed map string for this type.
Diffstat (limited to 'src/load.c')
| -rw-r--r-- | src/load.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/load.c b/src/load.c index 2e637aa19..d7f01347c 100644 --- a/src/load.c +++ b/src/load.c @@ -362,6 +362,12 @@ read_debug_record(mrb_state *mrb, const uint8_t *start, mrb_irep* irep, size_t * } } break; + case mrb_debug_line_packed_map: { + file->lines.packed_map = (char*)mrb_calloc(mrb, 1, (size_t)file->line_entry_count); + memcpy(file->lines.packed_map, bin, file->line_entry_count); + bin += file->line_entry_count; + } break; + default: return MRB_DUMP_GENERAL_FAILURE; } } |
