From 710045d6b5389be027fa389c8cc63e41ebec29f3 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 13 Oct 2021 09:42:17 +0200 Subject: erts: Print stackdump in crashdump/procdump with y prefix In OTP-23 the placement of the top frame was changed and that caused the stackdump printing algorithm to not prefix variables in the first frame with y. i.e. 0x00007f72440b76f0:N 0x00007f72440b76f8:SReturn addr 0x44381898 (proc_lib:init_p_do_apply/3 + 72) y0:P<0.9.0> y1:P<0.10.0> 0x00007f72440b7718:SReturn addr 0x66325748 () was written instead of y0:N 0x00007f72440b76f8:SReturn addr 0x44381898 (proc_lib:init_p_do_apply/3 + 72) y0:P<0.9.0> y1:P<0.10.0> 0x00007f72440b7718:SReturn addr 0x66325748 () The same issue was also fixed for erlang:process_display, erlang:process_info(backtrace) and the ctrl-c proc dump. --- erts/emulator/beam/erl_process_dump.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'erts/emulator/beam/erl_process_dump.c') diff --git a/erts/emulator/beam/erl_process_dump.c b/erts/emulator/beam/erl_process_dump.c index 3beafb4b3c..77bd344352 100644 --- a/erts/emulator/beam/erl_process_dump.c +++ b/erts/emulator/beam/erl_process_dump.c @@ -48,8 +48,8 @@ static void dump_process_info(fmtfn_t to, void *to_arg, Process *p); static void dump_element(fmtfn_t to, void *to_arg, Eterm x); static void dump_dist_ext(fmtfn_t to, void *to_arg, ErtsDistExternal *edep); static void dump_element_nl(fmtfn_t to, void *to_arg, Eterm x); -static int stack_element_dump(fmtfn_t to, void *to_arg, Eterm* sp, - int yreg); +static Uint stack_element_dump(fmtfn_t to, void *to_arg, Eterm* sp, + Uint yreg); static void stack_trace_dump(fmtfn_t to, void *to_arg, Eterm* sp); static void print_function_from_pc(fmtfn_t to, void *to_arg, ErtsCodePtr x); static void heap_dump(fmtfn_t to, void *to_arg, Eterm x); @@ -223,7 +223,7 @@ static void dump_process_info(fmtfn_t to, void *to_arg, Process *p) { Eterm* sp; - int yreg = -1; + Uint yreg = 0; if (ERTS_TRACE_FLAGS(p) & F_SENSITIVE) return; @@ -403,8 +403,8 @@ erts_limited_stack_trace(fmtfn_t to, void *to_arg, Process *p) } -static int -stack_element_dump(fmtfn_t to, void *to_arg, Eterm* sp, int yreg) +static Uint +stack_element_dump(fmtfn_t to, void *to_arg, Eterm* sp, Uint yreg) { Eterm x = *sp; -- cgit v1.2.1