diff --git a/agent/src/share/classes/sun/jvm/hotspot/bugspot/BugSpot.java b/agent/src/share/classes/sun/jvm/hotspot/bugspot/BugSpot.java index 668fba78372b9511215c7ffd4ab8c5a0c53a8e87..2ff5308b1589166d6697930ef7ba539ccae482a5 100644 --- a/agent/src/share/classes/sun/jvm/hotspot/bugspot/BugSpot.java +++ b/agent/src/share/classes/sun/jvm/hotspot/bugspot/BugSpot.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -657,7 +657,7 @@ public class BugSpot extends JPanel { while (fr != null) { trace.add(new StackTraceEntry(fr, getCDebugger())); try { - fr = fr.sender(); + fr = fr.sender(t); } catch (AddressException e) { e.printStackTrace(); showMessageDialog("Error while walking stack; stack trace will be truncated\n(see console for details)", diff --git a/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/amd64/BsdAMD64CFrame.java b/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/amd64/BsdAMD64CFrame.java index b27a539900991fd207a60314911b816e6af08f57..01d9b06dcd17bf8bc8d55157112a56504d364f01 100644 --- a/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/amd64/BsdAMD64CFrame.java +++ b/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/amd64/BsdAMD64CFrame.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,7 @@ package sun.jvm.hotspot.debugger.bsd.amd64; import sun.jvm.hotspot.debugger.*; +import sun.jvm.hotspot.debugger.amd64.*; import sun.jvm.hotspot.debugger.bsd.*; import sun.jvm.hotspot.debugger.cdbg.*; import sun.jvm.hotspot.debugger.cdbg.basic.*; @@ -51,8 +52,11 @@ final public class BsdAMD64CFrame extends BasicCFrame { return rbp; } - public CFrame sender() { - if (rbp == null) { + public CFrame sender(ThreadProxy thread) { + AMD64ThreadContext context = (AMD64ThreadContext) thread.getContext(); + Address rsp = context.getRegisterAsAddress(AMD64ThreadContext.RSP); + + if ( (rbp == null) || rbp.lessThan(rsp) ) { return null; } diff --git a/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/x86/BsdX86CFrame.java b/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/x86/BsdX86CFrame.java index 40292b921e637f1d1aeb2ac33721a33d2a5e493e..237223ed30893a12ad4e2ddeb1eb0cebd8850823 100644 --- a/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/x86/BsdX86CFrame.java +++ b/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/x86/BsdX86CFrame.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ import sun.jvm.hotspot.debugger.*; import sun.jvm.hotspot.debugger.bsd.*; import sun.jvm.hotspot.debugger.cdbg.*; import sun.jvm.hotspot.debugger.cdbg.basic.*; +import sun.jvm.hotspot.debugger.x86.*; final public class BsdX86CFrame extends BasicCFrame { // package/class internals only @@ -52,8 +53,11 @@ final public class BsdX86CFrame extends BasicCFrame { return ebp; } - public CFrame sender() { - if (ebp == null) { + public CFrame sender(ThreadProxy thread) { + X86ThreadContext context = (X86ThreadContext) thread.getContext(); + Address esp = context.getRegisterAsAddress(X86ThreadContext.ESP); + + if ( (ebp == null) || ebp.lessThan(esp) ) { return null; } diff --git a/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/CFrame.java b/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/CFrame.java index 30ddc298fd9c5c8fc84e78c54949cb674e269117..7640ddaa35e0a8f469bd99f7b1b427aa353b1bd6 100644 --- a/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/CFrame.java +++ b/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/CFrame.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,7 +34,7 @@ import sun.jvm.hotspot.debugger.*; public interface CFrame { /** Returns null when no more frames on stack */ - public CFrame sender(); + public CFrame sender(ThreadProxy th); /** Get the program counter of this frame */ public Address pc(); diff --git a/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/amd64/AMD64CFrame.java b/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/amd64/AMD64CFrame.java index 03b5dc572cac0aa5c6f5843a724958aabe668066..d6ec6b45003e6b4517027d702f56c6e33e5a7246 100644 --- a/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/amd64/AMD64CFrame.java +++ b/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/amd64/AMD64CFrame.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,7 @@ package sun.jvm.hotspot.debugger.cdbg.basic.amd64; import sun.jvm.hotspot.debugger.*; +import sun.jvm.hotspot.debugger.amd64.*; import sun.jvm.hotspot.debugger.cdbg.*; import sun.jvm.hotspot.debugger.cdbg.basic.*; @@ -43,8 +44,11 @@ public class AMD64CFrame extends BasicCFrame { this.pc = pc; } - public CFrame sender() { - if (rbp == null) { + public CFrame sender(ThreadProxy thread) { + AMD64ThreadContext context = (AMD64ThreadContext) thread.getContext(); + Address rsp = context.getRegisterAsAddress(AMD64ThreadContext.RSP); + + if ( (rbp == null) || rbp.lessThan(rsp) ) { return null; } diff --git a/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/x86/X86CFrame.java b/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/x86/X86CFrame.java index 0764a5da5e975cb5eb730cc0d466096f89963839..76b101bef972d75c4d13c8578b09d02e2e4db650 100644 --- a/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/x86/X86CFrame.java +++ b/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/x86/X86CFrame.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,7 @@ package sun.jvm.hotspot.debugger.cdbg.basic.x86; import sun.jvm.hotspot.debugger.*; +import sun.jvm.hotspot.debugger.x86.*; import sun.jvm.hotspot.debugger.cdbg.*; import sun.jvm.hotspot.debugger.cdbg.basic.*; @@ -43,8 +44,11 @@ public class X86CFrame extends BasicCFrame { this.pc = pc; } - public CFrame sender() { - if (ebp == null) { + public CFrame sender(ThreadProxy thread) { + X86ThreadContext context = (X86ThreadContext) thread.getContext(); + Address esp = context.getRegisterAsAddress(X86ThreadContext.ESP); + + if ( (ebp == null) || ebp.lessThan(esp) ) { return null; } diff --git a/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/amd64/LinuxAMD64CFrame.java b/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/amd64/LinuxAMD64CFrame.java index 3fab9a9e1d05e2ba6b1fdef7bc29cc352a5391ab..36977f1aeaa51d2b545d2a4a59a3593e253b41b3 100644 --- a/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/amd64/LinuxAMD64CFrame.java +++ b/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/amd64/LinuxAMD64CFrame.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,7 @@ package sun.jvm.hotspot.debugger.linux.amd64; import sun.jvm.hotspot.debugger.*; +import sun.jvm.hotspot.debugger.amd64.*; import sun.jvm.hotspot.debugger.linux.*; import sun.jvm.hotspot.debugger.cdbg.*; import sun.jvm.hotspot.debugger.cdbg.basic.*; @@ -51,8 +52,11 @@ final public class LinuxAMD64CFrame extends BasicCFrame { return rbp; } - public CFrame sender() { - if (rbp == null) { + public CFrame sender(ThreadProxy thread) { + AMD64ThreadContext context = (AMD64ThreadContext) thread.getContext(); + Address rsp = context.getRegisterAsAddress(AMD64ThreadContext.RSP); + + if ( (rbp == null) || rbp.lessThan(rsp) ) { return null; } diff --git a/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/sparc/LinuxSPARCCFrame.java b/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/sparc/LinuxSPARCCFrame.java index eb490b284b515815a582dd26a206aaa1b75391f8..d52f6b35ee091847aa80c68e6221982b9f521828 100644 --- a/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/sparc/LinuxSPARCCFrame.java +++ b/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/sparc/LinuxSPARCCFrame.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -57,7 +57,7 @@ final public class LinuxSPARCCFrame extends BasicCFrame { return sp; } - public CFrame sender() { + public CFrame sender(ThreadProxy thread) { if (sp == null) { return null; } diff --git a/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/x86/LinuxX86CFrame.java b/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/x86/LinuxX86CFrame.java index 67074c6533c316e2f86d32129a51da5dd3b2f64d..8d066720ea21ac526f713d47b67282826477930e 100644 --- a/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/x86/LinuxX86CFrame.java +++ b/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/x86/LinuxX86CFrame.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ import sun.jvm.hotspot.debugger.*; import sun.jvm.hotspot.debugger.linux.*; import sun.jvm.hotspot.debugger.cdbg.*; import sun.jvm.hotspot.debugger.cdbg.basic.*; +import sun.jvm.hotspot.debugger.x86.*; final public class LinuxX86CFrame extends BasicCFrame { // package/class internals only @@ -52,8 +53,11 @@ final public class LinuxX86CFrame extends BasicCFrame { return ebp; } - public CFrame sender() { - if (ebp == null) { + public CFrame sender(ThreadProxy thread) { + X86ThreadContext context = (X86ThreadContext) thread.getContext(); + Address esp = context.getRegisterAsAddress(X86ThreadContext.ESP); + + if ( (ebp == null) || ebp.lessThan(esp) ) { return null; } diff --git a/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcCFrame.java b/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcCFrame.java index 6b508e1e4e88679c63b1f812a7a5f1e69de6e18f..83d5f677a6e19f323572e768798c12d7141d682d 100644 --- a/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcCFrame.java +++ b/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcCFrame.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,7 +37,7 @@ final class ProcCFrame extends BasicCFrame { return fp; } - public CFrame sender() { + public CFrame sender(ThreadProxy t) { return sender; } diff --git a/agent/src/share/classes/sun/jvm/hotspot/tools/PStack.java b/agent/src/share/classes/sun/jvm/hotspot/tools/PStack.java index 671bfc81125f09cc6c3f935fd3f62fbc8c9af8d5..a087d4aa04e8a1ef540539c3e451198756e7640a 100644 --- a/agent/src/share/classes/sun/jvm/hotspot/tools/PStack.java +++ b/agent/src/share/classes/sun/jvm/hotspot/tools/PStack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -158,7 +158,7 @@ public class PStack extends Tool { printUnknown(out); } } - f = f.sender(); + f = f.sender(th); } } catch (Exception exp) { exp.printStackTrace();