comparison 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
comparison
equal deleted inserted replaced
6129:4d399f013e5a 6163:b87e5a681416
1 /* 1 /*
2 * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
23 */ 23 */
24 24
25 package sun.jvm.hotspot.debugger.cdbg.basic.x86; 25 package sun.jvm.hotspot.debugger.cdbg.basic.x86;
26 26
27 import sun.jvm.hotspot.debugger.*; 27 import sun.jvm.hotspot.debugger.*;
28 import sun.jvm.hotspot.debugger.x86.*;
28 import sun.jvm.hotspot.debugger.cdbg.*; 29 import sun.jvm.hotspot.debugger.cdbg.*;
29 import sun.jvm.hotspot.debugger.cdbg.basic.*; 30 import sun.jvm.hotspot.debugger.cdbg.basic.*;
30 31
31 /** Basic X86 frame functionality providing sender() functionality. */ 32 /** Basic X86 frame functionality providing sender() functionality. */
32 33
41 super(dbg); 42 super(dbg);
42 this.ebp = ebp; 43 this.ebp = ebp;
43 this.pc = pc; 44 this.pc = pc;
44 } 45 }
45 46
46 public CFrame sender() { 47 public CFrame sender(ThreadProxy thread) {
47 if (ebp == null) { 48 X86ThreadContext context = (X86ThreadContext) thread.getContext();
49 Address esp = context.getRegisterAsAddress(X86ThreadContext.ESP);
50
51 if ( (ebp == null) || ebp.lessThan(esp) ) {
48 return null; 52 return null;
49 } 53 }
50 54
51 Address nextEBP = ebp.getAddressAt( 0 * ADDRESS_SIZE); 55 Address nextEBP = ebp.getAddressAt( 0 * ADDRESS_SIZE);
52 if (nextEBP == null) { 56 if (nextEBP == null) {