thread_solaris_sparc.cpp revision 0
0N/A * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 0N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 0N/A * CA 95054 USA or visit www.sun.com if you need additional information or 0N/A * have any questions. 0N/A#
include "incls/_precompiled.incl" 0N/A// For Forte Analyzer AsyncGetCallTrace profiling support - thread is 0N/A// currently interrupted by SIGPROF 0N/A// NOTE: On Solaris, register windows are flushed in the signal handler 0N/A// except for possibly the top frame. 0N/A // make_walkable flushes register windows and grabs last_Java_pc 0N/A // which can not be done if the ucontext sp matches last_Java_sp 0N/A // stack walking utilities assume last_Java_pc set if marked flushed 0N/A // If we have a walkable last_Java_frame, then we should use it 0N/A // even if isInJava == true. It should be more reliable than 0N/A // This sanity check may not be needed with the new frame 0N/A // walking code. Remove it for now. 0N/A // the anchor contains an SP, but the frame is not walkable 0N/A // because post_Java_sp isn't valid relative to last_Java_sp 0N/A // At this point, we don't have a walkable last_Java_frame, so 0N/A // we try to glean some information out of the ucontext. 0N/A // ucontext wasn't useful 0N/A // we were running Java code when SIGPROF came in 0N/A // If we have a last_Java_sp, then the SIGPROF signal caught us 0N/A // right when we were transitioning from _thread_in_Java to a new 0N/A // JavaThreadState. We use last_Java_sp instead of the sp from 0N/A // the ucontext since it should be more reliable. 0N/A // Implied else: we don't have a last_Java_sp so we use what we 0N/A // got from the ucontext. 0N/A // nothing else to try if the frame isn't good 0N/A // At this point, we know we weren't running Java code. We might 0N/A // have a last_Java_sp, but we don't have a walkable frame. 0N/A // However, we might still be able to construct something useful 0N/A // if the thread was running native code. 0N/A // nothing else to try if the frame isn't good 0N/A // nothing else to try