diff options
Diffstat (limited to 'erts/emulator/beam/beam_debug.c')
-rw-r--r-- | erts/emulator/beam/beam_debug.c | 63 |
1 files changed, 58 insertions, 5 deletions
diff --git a/erts/emulator/beam/beam_debug.c b/erts/emulator/beam/beam_debug.c index abf00ecaf8..5b7e2a9414 100644 --- a/erts/emulator/beam/beam_debug.c +++ b/erts/emulator/beam/beam_debug.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1998-2021. All Rights Reserved. + * Copyright Ericsson AB 1998-2023. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -306,7 +306,7 @@ erts_debug_disassemble_1(BIF_ALIST_1) * But this code_ptr will point to the start of the Export, * not the function's func_info instruction. BOOM !? */ - cmfa = erts_code_to_codemfa(ep->addresses[code_ix]); + cmfa = erts_code_to_codemfa(ep->dispatch.addresses[code_ix]); } else if (modp == NULL || (code_hdr = modp->curr.code_hdr) == NULL) { BIF_RET(am_undef); } else { @@ -624,7 +624,11 @@ print_op(fmtfn_t to, void *to_arg, int op, int size, BeamInstr* addr) } break; default: +#ifdef ARCH_64 + erts_print(to, to_arg, "%ld", *ap); +#else erts_print(to, to_arg, "%d", *ap); +#endif } ap++; break; @@ -678,7 +682,7 @@ print_op(fmtfn_t to, void *to_arg, int op, int size, BeamInstr* addr) case 'F': /* Function definition */ { ErlFunEntry* fe = (ErlFunEntry *) *ap; - const ErtsCodeMFA *cmfa = erts_find_function_from_pc(fe->address); + const ErtsCodeMFA *cmfa = erts_get_fun_mfa(fe); erts_print(to, to_arg, "fun(`%T`:`%T`/%bpu)", cmfa->module, cmfa->function, cmfa->arity); ap++; @@ -885,7 +889,7 @@ print_op(fmtfn_t to, void *to_arg, int op, int size, BeamInstr* addr) } } break; - case op_i_make_fun3_Fdt: + case op_i_make_fun3_Fdtt: { int n = unpacked[-1]; @@ -905,6 +909,55 @@ print_op(fmtfn_t to, void *to_arg, int op, int size, BeamInstr* addr) } } break; + case op_i_bs_create_bin_jIWdW: + { + int n = unpacked[-1]; + int i = 0; + Eterm type = 0; + + while (n > 0) { + switch (i % 5) { + case 0: /* Type */ + type = ap[i]; + erts_print(to, to_arg, " `%d`", type); + break; + case 1: /* Unit */ + case 2: /* Flags */ + erts_print(to, to_arg, " `%d`", (Eterm) ap[i]); + break; + case 4: /* Size */ + if (type == BSC_BINARY_FIXED_SIZE || + type == BSC_FLOAT_FIXED_SIZE || + type == BSC_INTEGER_FIXED_SIZE || + type == BSC_STRING || + type == BSC_UTF32) { + erts_print(to, to_arg, " `%d`", ap[i]); + break; + } + + /*FALLTHROUGH*/ + case 3: /* Src */ + if (type == BSC_STRING) { + erts_print(to, to_arg, " "); + print_byte_string(to, to_arg, (byte *) ap[i], ap[i+1]); + break; + } + switch (loader_tag(ap[i])) { + case LOADER_X_REG: + erts_print(to, to_arg, " x(%d)", loader_x_reg_index(ap[i])); + break; + case LOADER_Y_REG: + erts_print(to, to_arg, " y(%d)", loader_y_reg_index(ap[i]) - CP_SIZE); + break; + default: + erts_print(to, to_arg, " `%T`", (Eterm) ap[i]); + break; + } + } + i++, size++, n--; + } + } + break; } erts_print(to, to_arg, "\n"); @@ -1085,7 +1138,7 @@ dirty_test(Process *c_p, Eterm type, Eterm arg1, Eterm arg2, ErtsCodePtr I) Eterm *hp, sz; Eterm cpy; /* We do not want this to be optimized, - but rather the oposite... */ + but rather the opposite... */ sz = size_object(arg2); hp = HAlloc(c_p, sz); cpy = copy_struct(arg2, sz, &hp, &c_p->off_heap); |