--- old/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/solaris_sparc/SolarisSPARCJavaThreadPDAccess.java 2009-08-01 04:06:47.435989445 +0100 +++ new/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/solaris_sparc/SolarisSPARCJavaThreadPDAccess.java 2009-08-01 04:06:47.346490541 +0100 @@ -19,7 +19,7 @@ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, * CA 95054 USA or visit www.sun.com if you need additional information or * have any questions. - * + * */ package sun.jvm.hotspot.runtime.solaris_sparc; @@ -54,18 +54,18 @@ private static synchronized void initialize(TypeDataBase db) { Type type = db.lookupType("JavaThread"); Type anchorType = db.lookupType("JavaFrameAnchor"); - + baseOfStackPointerField = type.getAddressField("_base_of_stack_pointer"); osThreadField = type.getAddressField("_osthread"); hasFlushed = db.lookupIntConstant("JavaFrameAnchor::flushed").intValue(); - + type = db.lookupType("OSThread"); osThreadThreadIDField = type.getCIntegerField("_thread_id"); } public Address getLastJavaFP(Address addr) { - return null; - + return null; + } public Address getLastJavaPC(Address addr) { @@ -98,7 +98,7 @@ // sparc does a lazy window flush. The _flags field of the JavaFrameAnchor // encodes whether the windows have flushed. Whenever the windows have flushed - // there will be a last_Java_pc. + // there will be a last_Java_pc. // In a relective system we'd have to do something to force the thread to flush // its windows and give us the pc (or the younger_sp so we can find it ourselves) // In a debugger situation (process or core) the flush should have happened and @@ -108,12 +108,12 @@ return new SPARCFrame(SPARCFrame.biasSP(thread.getLastJavaSP()), thread.getLastJavaPC()); } else { Frame top = getCurrentFrameGuess(thread, addr); - return new SPARCFrame(SPARCFrame.biasSP(thread.getLastJavaSP()), - SPARCFrame.biasSP(SPARCFrame.findYoungerSP(top.getSP(), thread.getLastJavaSP())), - false); + return new SPARCFrame(SPARCFrame.biasSP(thread.getLastJavaSP()), + SPARCFrame.biasSP(SPARCFrame.findYoungerSP(top.getSP(), thread.getLastJavaSP())), + false); } - + } public RegisterMap newRegisterMap(JavaThread thread, boolean updateMap) { @@ -121,11 +121,13 @@ } public Frame getCurrentFrameGuess(JavaThread thread, Address addr) { + // If java stack is walkable then both last_Java_sp and last_Java_pc are // non null and we can start stack walk from this frame. if (thread.getLastJavaSP() != null && thread.getLastJavaPC() != null) { return new SPARCFrame(SPARCFrame.biasSP(thread.getLastJavaSP()), thread.getLastJavaPC()); } + ThreadProxy t = getThreadProxy(addr); SPARCThreadContext context = (SPARCThreadContext) t.getContext(); // For now, let's see what happens if we do a similar thing to