Index: vm/vmcore/src/util/linux/signals_ipf.cpp =================================================================== --- vm/vmcore/src/util/linux/signals_ipf.cpp (revision 617918) +++ vm/vmcore/src/util/linux/signals_ipf.cpp (working copy) @@ -434,7 +434,18 @@ { ucontext_t *uc = (ucontext_t *)context; Global_Env *env = VM_Global_State::loader_env; + Registers regs; + ucontext_to_regs(®s, uc); + if (!p_TLS_vmthread) + { + if (!is_gdb_crash_handler_enabled() || + !gdb_crash_handler(®s)) + { + // print stack trace + sd_print_stack(®s); + } + } /* Will not compile on IPF: TRACE2("signals", "NPE or SOE detected at " << @@ -452,8 +463,6 @@ } } fprintf(stderr, "SIGSEGV in VM code.\n"); - Registers regs; - ucontext_to_regs(®s, uc); // setup default handler signal(signum, SIG_DFL); Index: vm/vmcore/src/util/ipf/base/native_stack_ipf.cpp =================================================================== --- vm/vmcore/src/util/ipf/base/native_stack_ipf.cpp (revision 617918) +++ vm/vmcore/src/util/ipf/base/native_stack_ipf.cpp (working copy) @@ -24,7 +24,6 @@ void native_get_frame_info(Registers* regs, void** ip, void** bp, void** sp) { // FIXME: not implemented - abort(); } bool native_unwind_bp_based_frame(void* frame, void** ip, void** bp, void** sp) Index: vm/vmcore/src/util/ipf/base/signals_arch.cpp =================================================================== --- vm/vmcore/src/util/ipf/base/signals_arch.cpp (revision 0) +++ vm/vmcore/src/util/ipf/base/signals_arch.cpp (revision 0) @@ -0,0 +1,46 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include "vm_core_types.h" + +void print_reg_state(Registers* regs) +{ + fprintf(stderr, "Registers:"); + + for (int gn = 0; gn < 8; gn++) + { + fprintf(stderr, "\n GR %2d-%2d:", gn*4, (gn+1)*4 - 1); + for (int gc = 0; gc < 4; gc++) + fprintf(stderr, " 0x%"W_PI_FMT, regs->gr[gn*4 + gc]); + } + + for (int bn = 0; bn < 2; bn++) + { + fprintf(stderr, "\n BR %2d-%2d:", bn*4, (bn+1)*4 - 1); + for (int bc = 0; bc < 4; bc++) + fprintf(stderr, " 0x%"W_PI_FMT, regs->br[bn*4 + bc]); + } + + fprintf(stderr, "\n"); + fprintf(stderr, " preds: 0x%"W_PI_FMT"\n", regs->preds); + fprintf(stderr, " nats: 0x%"W_PI_FMT"\n", regs->nats); + fprintf(stderr, " pfs: 0x%"W_PI_FMT"\n", regs->pfs); + fprintf(stderr, " bsp: 0x%"W_PI_FMT"\n", (POINTER_SIZE_INT)regs->bsp); + fprintf(stderr, " *bsp: 0x%"W_PI_FMT"\n", regs->bsp ? (*regs->bsp) : 0); + fprintf(stderr, " ip: 0x%"W_PI_FMT"\n", regs->ip); +} Property changes on: vm/vmcore/src/util/ipf/base/signals_arch.cpp ___________________________________________________________________ Name: svn:executable + *