aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/hipe/hipe_debug.c
diff options
context:
space:
mode:
authorMikael Pettersson <[email protected]>2017-11-05 10:19:09 +0100
committerMikael Pettersson <[email protected]>2017-11-05 10:19:09 +0100
commite58e6c2db1f8b01f0adca778456ff5e1f9475038 (patch)
treee376f69685a53acffc830a7f65e7019e2268d566 /erts/emulator/hipe/hipe_debug.c
parenta8264b52677abba29505a8bb597e2aaf6d3258d9 (diff)
downloadotp-e58e6c2db1f8b01f0adca778456ff5e1f9475038.tar.gz
otp-e58e6c2db1f8b01f0adca778456ff5e1f9475038.tar.bz2
otp-e58e6c2db1f8b01f0adca778456ff5e1f9475038.zip
fix output formatting in hipe_bifs:show_heap/1
When the code switches from printf() to erts_printf() the output becomes garbled. Fixed by fflush()ing stdout first. Fixed formatting of the "H E A P" banner for 64-bit systems.
Diffstat (limited to 'erts/emulator/hipe/hipe_debug.c')
-rw-r--r--erts/emulator/hipe/hipe_debug.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/erts/emulator/hipe/hipe_debug.c b/erts/emulator/hipe/hipe_debug.c
index 222a11db3d..cfe60b379e 100644
--- a/erts/emulator/hipe/hipe_debug.c
+++ b/erts/emulator/hipe/hipe_debug.c
@@ -135,7 +135,9 @@ static void print_heap(Eterm *pos, Eterm *end)
printf("From: 0x%0*lx to 0x%0*lx\n\r",
2*(int)sizeof(long), (unsigned long)pos,
2*(int)sizeof(long), (unsigned long)end);
- printf(" | H E A P |\r\n");
+ printf(" | %*s H E A P %*s |\r\n",
+ 2*(int)sizeof(long)-1, "",
+ 2*(int)sizeof(long)-1, "");
printf(" | %*s | %*s |\r\n",
2+2*(int)sizeof(long), "Address",
2+2*(int)sizeof(long), "Contents");
@@ -158,8 +160,10 @@ static void print_heap(Eterm *pos, Eterm *end)
++pos;
--ari;
}
- } else
+ } else {
+ fflush(stdout);
erts_printf("%.30T", val);
+ }
printf("\r\n");
}
printf(" |%s|%s|\r\n", dashes, dashes);