diff options
author | Mikael Pettersson <[email protected]> | 2017-11-11 14:29:16 +0100 |
---|---|---|
committer | Mikael Pettersson <[email protected]> | 2017-11-11 14:29:16 +0100 |
commit | d71c5604e7ba5e30391c493fb46e67a0284cef76 (patch) | |
tree | 7245a27858b48bc65a4a3eeb719600e16ee7eb2f /erts/emulator/hipe/hipe_x86_stack.c | |
parent | 3fb3067d953f8be9fe66d3a6687a86be2e8d2f3f (diff) | |
download | otp-d71c5604e7ba5e30391c493fb46e67a0284cef76.tar.gz otp-d71c5604e7ba5e30391c493fb46e67a0284cef76.tar.bz2 otp-d71c5604e7ba5e30391c493fb46e67a0284cef76.zip |
fix output formatting in several HiPE debug BIFs
Fix formatting in hipe_bifs:show_pcb/1, hipe_bifs:show_estack/1,
and hipe_bifs:show_nstack/1.
fflush(stdout) before switching from printf() to erts_printf() to
avoid garbled output.
Adjust field lengths to work on both 64- and 32-bit systems.
Tested on Linux/x86_64 (64-bit) and Linux/ARMv7 (32-bit).
Diffstat (limited to 'erts/emulator/hipe/hipe_x86_stack.c')
-rw-r--r-- | erts/emulator/hipe/hipe_x86_stack.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/erts/emulator/hipe/hipe_x86_stack.c b/erts/emulator/hipe/hipe_x86_stack.c index 31582b3a2e..615e07917a 100644 --- a/erts/emulator/hipe/hipe_x86_stack.c +++ b/erts/emulator/hipe/hipe_x86_stack.c @@ -43,8 +43,10 @@ static void print_slot(Eterm *sp, unsigned int live) printf(" | 0x%0*lx | 0x%0*lx | ", 2*(int)sizeof(long), (unsigned long)sp, 2*(int)sizeof(long), val); - if (live) + if (live) { + fflush(stdout); erts_printf("%.30T", val); + } printf("\r\n"); } @@ -74,7 +76,9 @@ void hipe_print_nstack(Process *p) sdesc0.livebits[0] = ~1; sdesc = &sdesc0; - printf(" | NATIVE STACK |\r\n"); + printf(" | %*s NATIVE STACK %*s |\r\n", + 2*(int)sizeof(long)-5, "", + 2*(int)sizeof(long)-4, ""); printf(" |%s|%s|\r\n", dashes, dashes); printf(" | %*s | 0x%0*lx |\r\n", 2+2*(int)sizeof(long), "heap", |