From d9aabbb6e0a5e8a07956a3d460053b6c14f7250e Mon Sep 17 00:00:00 2001 From: pm Date: Sun, 19 Aug 2007 09:27:03 +0000 Subject: [PATCH] * vm/builtin.c (builtin_trace_exception) [__s390__]: Decrement TRACEJAVACALLINDENT instead of methodindent. * vm/jit/trace.h: Adapted file to coding conventions. * vm/jit/trace.c: Likewise. * vm/jit/s390/md.c (md_dump_context) Fixed printing of java method at failing address, (md_signal_handler_sigsegv) added missing default branch to switch. --- src/vm/builtin.c | 11 ++++++++++- src/vm/jit/s390/md.c | 7 +++++-- src/vm/jit/trace.c | 44 +++++++++++++++++++++++++++++++++++++++++++- src/vm/jit/trace.h | 44 ++++++++++++++++---------------------------- 4 files changed, 74 insertions(+), 32 deletions(-) diff --git a/src/vm/builtin.c b/src/vm/builtin.c index fe5001019..190ea15e9 100644 --- a/src/vm/builtin.c +++ b/src/vm/builtin.c @@ -28,7 +28,7 @@ calls instead of machine instructions, using the C calling convention. - $Id: builtin.c 8330 2007-08-16 18:15:51Z twisti $ + $Id: builtin.c 8348 2007-08-19 09:27:03Z pm $ */ @@ -60,6 +60,11 @@ #include "native/include/java_lang_Throwable.h" #include "threads/lock-common.h" +#if defined(ENABLE_THREADS) +#include "threads/native/threads.h" +#else +#include "threads/none/threads.h" +#endif #include "toolbox/logging.h" #include "toolbox/util.h" @@ -1187,7 +1192,11 @@ java_handle_t *builtin_trace_exception(java_handle_t *xptr, #endif if (opt_verbosecall && indent) +#if defined(__S390__) + TRACEJAVACALLINDENT--; +#else methodindent--; +#endif /* calculate message length */ diff --git a/src/vm/jit/s390/md.c b/src/vm/jit/s390/md.c index b257a4035..e5d1c28ca 100644 --- a/src/vm/jit/s390/md.c +++ b/src/vm/jit/s390/md.c @@ -22,7 +22,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - $Id: md.c 8298 2007-08-12 18:49:16Z pm $ + $Id: md.c 8348 2007-08-19 09:27:03Z pm $ */ @@ -104,7 +104,7 @@ void md_dump_context(u1 *pc, mcontext_t *mc) { m = (*(codeinfo **)(pv + CodeinfoPointer))->m; log_println( "Java method: class %s, method %s, descriptor %s.", - utf_bytes(m->class->name), utf_bytes(m->name), utf_bytes(m->descriptor) + m->class->name->text, m->name->text, m->descriptor->text ); } @@ -175,6 +175,9 @@ void md_signal_handler_sigsegv(int sig, siginfo_t *siginfo, void *_p) is_null = 0; } break; + default: + is_null = 0; + break; } if (! is_null) { diff --git a/src/vm/jit/trace.c b/src/vm/jit/trace.c index 238f439cf..4e71f8d17 100644 --- a/src/vm/jit/trace.c +++ b/src/vm/jit/trace.c @@ -22,10 +22,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - $Id: trace.c 8317 2007-08-16 06:53:26Z pm $ + $Id: trace.c 8348 2007-08-19 09:27:03Z pm $ */ +#include "config.h" + #include "arch.h" #include "md-abi.h" @@ -248,6 +250,19 @@ static char *trace_java_call_print_argument(char *logtext, s4 *logtextlen, return logtext; } +/* trace_java_call_enter ****************************************************** + + Traces an entry into a java method. + + arg_regs: Array of size ARG_CNT containing all argument registers in + the same format as in asm_vm_call_method. The array is usually allocated + on the stack and used for restoring the argument registers later. + + stack: Pointer to first on stack argument in the same format passed to + asm_vm_call_method. + +*******************************************************************************/ + void trace_java_call_enter(methodinfo *m, uint64_t *arg_regs, uint64_t *stack) { methoddesc *md; paramdesc *pd; @@ -367,6 +382,20 @@ void trace_java_call_enter(methodinfo *m, uint64_t *arg_regs, uint64_t *stack) { } +/* trace_java_call_exit ******************************************************** + + Traces an exit form a java method. + + return_regs: Array of size 3 containing return registers: + [0] : REG_RESULT + [1] : REG_RESULT2 (if available on architecture) + [2] : REG_FRESULT + The array is usually allocated on the stack and used for restoring the + registers later. The format of the array is the same as the format of + register arguments passed to asm_vm_call_method. + +*******************************************************************************/ + void trace_java_call_exit(methodinfo *m, uint64_t *return_regs) { methoddesc *md; @@ -452,3 +481,16 @@ void trace_java_call_exit(methodinfo *m, uint64_t *return_regs) #endif /* !defined(NDEBUG) */ +/* + * These are local overrides for various environment variables in Emacs. + * Please do not remove this and leave it at the end of the file, where + * Emacs will automagically detect them. + * --------------------------------------------------------------------- + * Local variables: + * mode: c + * indent-tabs-mode: t + * c-basic-offset: 4 + * tab-width: 4 + * End: + * vim:noexpandtab:sw=4:ts=4: + */ diff --git a/src/vm/jit/trace.h b/src/vm/jit/trace.h index 971203e26..1cfa6d511 100644 --- a/src/vm/jit/trace.h +++ b/src/vm/jit/trace.h @@ -22,51 +22,39 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - $Id: trace.h 8304 2007-08-14 19:57:20Z pm $ + $Id: trace.h 8348 2007-08-19 09:27:03Z pm $ */ #ifndef _VM_JIT_TRACE_H #define _VM_JIT_TRACE_H +#include "config.h" + #include #include "vmcore/method.h" #if !defined(NDEBUG) -/* trace_java_call_enter ****************************************************** - - Traces an entry into a java method. - - arg_regs: Array of size ARG_CNT containing all argument registers in - the same format as in asm_vm_call_method. The array is usually allocated - on the stack and used for restoring the argument registers later. - - stack: Pointer to first on stack argument in the same format passed to - asm_vm_call_method. - -*******************************************************************************/ - void trace_java_call_enter(methodinfo *m, uint64_t *arg_regs, uint64_t *stack); -/* trace_java_call_exit ******************************************************** - - Traces an exit form a java method. - - return_regs: Array of size 3 containing return registers: - [0] : REG_RESULT - [1] : REG_RESULT2 (if available on architecture) - [2] : REG_FRESULT - The array is usually allocated on the stack and used for restoring the - registers later. The format of the array is the same as the format of - register arguments passed to asm_vm_call_method. - -*******************************************************************************/ - void trace_java_call_exit(methodinfo *m, uint64_t *return_regs); #endif /* !defined(NDEBUG) */ #endif +/* + * These are local overrides for various environment variables in Emacs. + * Please do not remove this and leave it at the end of the file, where + * Emacs will automagically detect them. + * --------------------------------------------------------------------- + * Local variables: + * mode: c + * indent-tabs-mode: t + * c-basic-offset: 4 + * tab-width: 4 + * End: + * vim:noexpandtab:sw=4:ts=4: + */ -- 2.25.1