comparison agent/src/share/classes/sun/jvm/hotspot/debugger/linux/x86/LinuxX86CFrame.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 651919d134f7
comparison
equal deleted inserted replaced
6129:4d399f013e5a 6163:b87e5a681416
1 /* 1 /*
2 * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2003, 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.
26 26
27 import sun.jvm.hotspot.debugger.*; 27 import sun.jvm.hotspot.debugger.*;
28 import sun.jvm.hotspot.debugger.linux.*; 28 import sun.jvm.hotspot.debugger.linux.*;
29 import sun.jvm.hotspot.debugger.cdbg.*; 29 import sun.jvm.hotspot.debugger.cdbg.*;
30 import sun.jvm.hotspot.debugger.cdbg.basic.*; 30 import sun.jvm.hotspot.debugger.cdbg.basic.*;
31 import sun.jvm.hotspot.debugger.x86.*;
31 32
32 final public class LinuxX86CFrame extends BasicCFrame { 33 final public class LinuxX86CFrame extends BasicCFrame {
33 // package/class internals only 34 // package/class internals only
34 public LinuxX86CFrame(LinuxDebugger dbg, Address ebp, Address pc) { 35 public LinuxX86CFrame(LinuxDebugger dbg, Address ebp, Address pc) {
35 super(dbg.getCDebugger()); 36 super(dbg.getCDebugger());
50 51
51 public Address localVariableBase() { 52 public Address localVariableBase() {
52 return ebp; 53 return ebp;
53 } 54 }
54 55
55 public CFrame sender() { 56 public CFrame sender(ThreadProxy thread) {
56 if (ebp == null) { 57 X86ThreadContext context = (X86ThreadContext) thread.getContext();
58 Address esp = context.getRegisterAsAddress(X86ThreadContext.ESP);
59
60 if ( (ebp == null) || ebp.lessThan(esp) ) {
57 return null; 61 return null;
58 } 62 }
59 63
60 Address nextEBP = ebp.getAddressAt( 0 * ADDRESS_SIZE); 64 Address nextEBP = ebp.getAddressAt( 0 * ADDRESS_SIZE);
61 if (nextEBP == null) { 65 if (nextEBP == null) {