diff agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/x86/X86CFrame.java @ 6163:b87e5a681416

6310967: SA: jstack -m produce failures in output Summary: While looking for the sender frame check that the frame pointer should not be less than the stack pointer. Reviewed-by: dholmes, sla
author poonam
date Thu, 14 Jun 2012 02:12:46 -0700
parents c18cbe5936b8
children
line wrap: on
line diff
--- a/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/x86/X86CFrame.java	Mon Jun 11 13:10:14 2012 -0400
+++ b/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/x86/X86CFrame.java	Thu Jun 14 02:12:46 2012 -0700
@@ -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 @@
     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;
     }