From 49c136df375a5c9a831f044eb2e3fb3352429cee Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Wed, 30 Nov 2011 16:51:44 +0100 Subject: erts: Make erts_printf accept internal match states This is useful during debugging to prevent erts_printf from crashing when passed a match state term. --- erts/emulator/beam/erl_printf_term.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'erts/emulator/beam') diff --git a/erts/emulator/beam/erl_printf_term.c b/erts/emulator/beam/erl_printf_term.c index 34da9cab84..2320b64295 100644 --- a/erts/emulator/beam/erl_printf_term.c +++ b/erts/emulator/beam/erl_printf_term.c @@ -437,7 +437,10 @@ print_term(fmtfn_t fn, void* arg, Eterm obj, long *dcount, } break; case BINARY_DEF: - { + if (header_is_bin_matchstate(*boxed_val(wobj))) { + PRINT_STRING(res, fn, arg, "#MatchState"); + } + else { ProcBin* pb = (ProcBin *) binary_val(wobj); if (pb->size == 1) PRINT_STRING(res, fn, arg, "<<1 byte>>"); -- cgit v1.2.3