aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/beam_debug.c
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2015-06-17 11:23:11 +0200
committerBjörn-Egil Dahlberg <[email protected]>2015-06-17 11:23:11 +0200
commitdb193ba5dac15b1341a622307adbaf55002531b4 (patch)
treeb715d2f16d7732f542421810dbb8fc10aa9f54fe /erts/emulator/beam/beam_debug.c
parentd57bf76c50e5193312babc39ea5324e9f549a4b8 (diff)
downloadotp-db193ba5dac15b1341a622307adbaf55002531b4.tar.gz
otp-db193ba5dac15b1341a622307adbaf55002531b4.tar.bz2
otp-db193ba5dac15b1341a622307adbaf55002531b4.zip
erts: Fix erts_debug:df/1 in debug
Sentinels in select_tuple_arity instructions are not proper tuple arities and thus cannot be checked in debug. Print them as small integers instead.
Diffstat (limited to 'erts/emulator/beam/beam_debug.c')
-rw-r--r--erts/emulator/beam/beam_debug.c40
1 files changed, 22 insertions, 18 deletions
diff --git a/erts/emulator/beam/beam_debug.c b/erts/emulator/beam/beam_debug.c
index 0367ca8aba..78ddecafc3 100644
--- a/erts/emulator/beam/beam_debug.c
+++ b/erts/emulator/beam/beam_debug.c
@@ -616,24 +616,28 @@ print_op(int to, void *to_arg, int op, int size, BeamInstr* addr)
case op_i_select_tuple_arity_rfI:
case op_i_select_tuple_arity_xfI:
case op_i_select_tuple_arity_yfI:
- {
- int n = ap[-1];
- int ix = n;
-
- while (ix--) {
- Uint arity = arityval(ap[0]);
- erts_print(to, to_arg, "{%d} ", arity, ap[1]);
- ap++;
- size++;
- }
- ix = n;
- while (ix--) {
- erts_print(to, to_arg, "f(" HEXF ") ", ap[0]);
- ap++;
- size++;
- }
- }
- break;
+ {
+ int n = ap[-1];
+ int ix = n - 1; /* without sentinel */
+
+ while (ix--) {
+ Uint arity = arityval(ap[0]);
+ erts_print(to, to_arg, "{%d} ", arity, ap[1]);
+ ap++;
+ size++;
+ }
+ /* print sentinel */
+ erts_print(to, to_arg, "{%T} ", ap[0], ap[1]);
+ ap++;
+ size++;
+ ix = n;
+ while (ix--) {
+ erts_print(to, to_arg, "f(" HEXF ") ", ap[0]);
+ ap++;
+ size++;
+ }
+ }
+ break;
case op_i_jump_on_val_rfII:
case op_i_jump_on_val_xfII:
case op_i_jump_on_val_yfII: