Skip to content

Commit

Permalink
fixup! Teach the BEAM loader to load debug information
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorng committed Sep 5, 2024
1 parent 1873300 commit c240f1d
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions erts/emulator/beam/jit/asm_load.c
Original file line number Diff line number Diff line change
Expand Up @@ -867,8 +867,8 @@ static const BeamDebugTab *finish_debug_table(LoaderState *stp,
BeamDebugTab *debug_tab_top;
Eterm *debug_tab_terms;
BeamDebugItem *debug_tab_items;
Uint item_count = (Uint) debug->item_count;
Uint term_count = (Uint) debug->term_count;
Uint item_count = (Uint)debug->item_count;
Uint term_count = (Uint)debug->term_count;
Uint i;

if (item_count == 0) {
Expand All @@ -879,25 +879,26 @@ static const BeamDebugTab *finish_debug_table(LoaderState *stp,
debug_tab_rw_base = get_writable_ptr(stp->executable_region,
stp->writable_region,
debug_tab_ro);
debug_tab_top = (BeamDebugTab *) debug_tab_rw_base;
debug_tab_terms = (Eterm *) (debug_tab_top + 1);
debug_tab_items = (BeamDebugItem *) (debug_tab_terms + term_count);
debug_tab_top = (BeamDebugTab *)debug_tab_rw_base;
debug_tab_terms = (Eterm *)(debug_tab_top + 1);
debug_tab_items = (BeamDebugItem *)(debug_tab_terms + term_count);

debug_tab_top->item_count = debug->item_count;
debug_tab_top->items = debug_tab_items;

for (i = 0; i < term_count; i++) {
if (debug->is_literal[i]) {
ASSERT(debug->is_literal[i] == 1);
debug_tab_terms[i] = beamfile_get_literal(&stp->beam, debug->terms[i]);
debug_tab_terms[i] =
beamfile_get_literal(&stp->beam, debug->terms[i]);
} else {
ASSERT(debug->is_literal[i] == 0);
debug_tab_terms[i] = debug->terms[i];
}
}

for (i = 0; i < item_count; i++) {
Uint num_vars = (Uint) debug->items[i].num_vars;
Uint num_vars = (Uint)debug->items[i].num_vars;

debug_tab_items[i].frame_size = debug->items[i].frame_size;
debug_tab_items[i].num_vars = num_vars;
Expand Down

0 comments on commit c240f1d

Please sign in to comment.