diff options
author | Pekka Enberg <penberg@kernel.org> | 2013-04-15 20:46:52 +0300 |
---|---|---|
committer | Pekka Enberg <penberg@kernel.org> | 2013-04-15 20:56:45 +0300 |
commit | c011aa175831dbd35cecb5be4d303d43854a09ad (patch) | |
tree | 589f02c5a20eadf9f65e1704699ee759afe846ff | |
parent | 444192e982f9959b6e63d79a0d1cfbbbb328951b (diff) | |
download | jato-c011aa175831dbd35cecb5be4d303d43854a09ad.tar.gz |
jit, x86: Show entered method on stack alignment error
Signed-off-by: Pekka Enberg <penberg@kernel.org>
-rw-r--r-- | arch/x86/debug.c | 7 | ||||
-rw-r--r-- | include/arch/debug.h | 4 | ||||
-rw-r--r-- | jit/trampoline.c | 2 |
3 files changed, 9 insertions, 4 deletions
diff --git a/arch/x86/debug.c b/arch/x86/debug.c index 6c8d9a6a..e73ab16c 100644 --- a/arch/x86/debug.c +++ b/arch/x86/debug.c @@ -1,11 +1,13 @@ #include "arch/debug.h" #include "arch/stack-frame.h" +#include "vm/method.h" +#include "vm/class.h" #include <stdlib.h> #include <stdio.h> -void check_stack_align(void) +void check_stack_align(struct vm_method *vmm) { #ifdef CONFIG_X86_32 register unsigned long fp __asm__("ebp"); @@ -14,7 +16,8 @@ void check_stack_align(void) #endif if (fp % X86_STACK_ALIGN != 0) { - fprintf(stderr, "Error: stack is %lu bytes misaligned.\n", fp % X86_STACK_ALIGN); + fprintf(stderr, "Error: stack is %lu bytes misaligned when entering %s.%s%s.\n", + fp % X86_STACK_ALIGN, vmm->class->name, vmm->name, vmm->type); abort(); } } diff --git a/include/arch/debug.h b/include/arch/debug.h index 3d5e5e3c..002f4412 100644 --- a/include/arch/debug.h +++ b/include/arch/debug.h @@ -1,6 +1,8 @@ #ifndef JATO_ARCH_DEBUG_H #define JATO_ARCH_DEBUG_H -void check_stack_align(void); +struct vm_method; + +void check_stack_align(struct vm_method *); #endif diff --git a/jit/trampoline.c b/jit/trampoline.c index 5329b4c2..29eb77aa 100644 --- a/jit/trampoline.c +++ b/jit/trampoline.c @@ -100,7 +100,7 @@ void *jit_magic_trampoline(struct compilation_unit *cu) void *ret; if (opt_debug_stack) - check_stack_align(); + check_stack_align(method); if (opt_trace_magic_trampoline) trace_magic_trampoline(cu); |