sa-jdi

tPrevIFrame()
  {
    return lastJavaIFrameField.getValue(addr);
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.runtime.ia64.IA64JavaCallWrapper
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.runtime.ia64;

import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.runtime.JavaThread;
import sun.jvm.hotspot.runtime.RegisterMap;
import sun.jvm.hotspot.runtime.VMReg;

public class IA64RegisterMap
  extends RegisterMap
{
  public IA64RegisterMap(JavaThread thread, boolean updateMap)
  {
    super(thread, updateMap);
  }
  
  protected IA64RegisterMap(RegisterMap map)
  {
    super(map);
  }
  
  public Object clone()
  {
    IA64RegisterMap retval = new IA64RegisterMap(this);
    return retval;
  }
  
  protected void clearPD() {}
  
  protected void initializePD() {}
  
  protected void initializeFromPD(RegisterMap map) {}
  
  protected Address getLocationPD(VMReg reg)
  {
    return null;
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.runtime.ia64.IA64RegisterMap
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.runtime;

import java.util.ArrayList;
import java.util.List;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.interpreter.OopMapCacheEntry;
import sun.jvm.hotspot.oops.Method;
import sun.jvm.hotspot.utilities.Assert;

public class InterpretedVFrame
  extends JavaVFrame
{
  public Method getMethod()
  {
    return getFrame().getInterpreterFrameMethod();
  }
  
  public StackValueCollection getLocals()
  {
    Method m = getMethod();
    
    int length = (int)m.getMaxLocals();
    if (m.isNative()) {
      length = (int)m.getSizeOfParameters();
    }
    StackValueCollection result = new StackValueCollection(length);
    
    OopMapCacheEntry oopMask = getMethod().getMaskFor(getBCI());
    for (int i = 0; i < length; i++)
    {
      Address addr = addressOfLocalAt(i);
      StackValue sv;
      StackValue sv;
      if (oopMask.isOop(i)) {
        sv = new StackValue(addr.getOopHandleAt(0L), 0L);
      } else {
        sv = new StackValue(addr.getCIntegerAt(0L, VM.getVM().getAddressSize(), false));
      }
      result.add(sv);
    }
    return result;
  }
  
  public StackValueCollection getExpressions()
  {
    int length = getFrame().getInterpreterFrameExpressionStackSize();
    if (getMethod().isNative()) {
      length = 0;
    }
    int nofLocals = (int)getMethod().getMaxLocals();
    StackValueCollection result = new StackValueCollection(length);
    
    OopMapCacheEntry oopMask = getMethod().getMaskFor(getBCI());
    for (int i = 0; i < length; i++)
    {
      Address addr = addressOfExpressionStackAt(i);
      StackValue sv;
      StackValue sv;
      if (oopMask.isOop(i + nofLocals)) {
        sv = new StackValue(addr.getOopHandleAt(0L), 0L);
      } else {
        sv = new StackValue(addr.getCIntegerAt(0L, VM.getVM().getAddressSize(), false));
      }
      result.add(sv);
    }
    return result;
  }
  
  public List getMonitors()
  {
    List result = new ArrayList(5);
    for (BasicObjectLock current = getFrame().interpreterFrameMonitorEnd(); current.address().lessThan(getFrame().interpreterFrameMonitorBegin().address()); current = getFrame().nextMonitorInInterpreterFrame(current)) {
      result.add(new MonitorInfo(current.obj(), current.lock(), false, false));
    }
    return result;
  }
  
  public boolean isInterpretedFrame()
  {
    return true;
  }
  
  InterpretedVFrame(Frame fr, RegisterMap regMap, JavaThread thread)
  {
    super(fr, regMap, thread);
  }
  
  public int getBCI()
  {
    return getFrame().getInterpreterFrameBCI();
  }
  
  public void verify() {}
  
  private Address addressOfLocalAt(int index)
  {
    if (Assert.ASSERTS_ENABLED) {
      Assert.that(getFrame().isInterpretedFrame(), "frame should be an interpreted frame");
    }
    return fr.addressOfInterpreterFrameLocal(index);
  }
  
  private Address addressOfExpressionStackAt(int index)
  {
    return fr.addressOfInterpreterFrameExpressionStackSlot(index);
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.runtime.InterpretedVFrame
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.runtime;

import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.interpreter.OffsetClosure;
import sun.jvm.hotspot.utilities.AddressOps;
import sun.jvm.hotspot.utilities.Assert;

class InterpreterFrameClosure
  implements OffsetClosure
{
  private static final boolean DEBUG = false;
  private Frame fr;
  private AddressVisitor f;
  private int maxLocals;
  private int maxStack;
  
  InterpreterFrameClosure(Frame fr, int maxLocals, int maxStack, AddressVisitor f)
  {
    this.fr = fr;
    this.maxLocals = maxLocals;
    this.maxStack = maxStack;
    this.f = f;
  }
  
  public void offsetDo(int offset)
  {
    if (offset < maxLocals)
    {
      Address addr = fr.addressOfInterpreterFrameLocal(offset);
      if (Assert.ASSERTS_ENABLED) {
        Assert.that(AddressOps.gte(addr, fr.getSP()), "must be inside the frame");
      }
      f.visitAddress(addr);
    }
    else
    {
      Address addr = fr.addressOfInterpreterFrameExpressionStackSlot(offset - maxLocals);
      boolean inStack;
      boolean inStack;
      if (fr.getInterpreterFrameExpressionStackDirection() > 0) {
        inStack = AddressOps.lte(addr, fr.addressOfInterpreterFrameTOS());
      } else {
        inStack = AddressOps.gte(addr, fr.addressOfInterpreterFrameTOS());
      }
      if (inStack) {
        f.visitAddress(addr);
      }
    }
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.runtime.InterpreterFrameClosure
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.runtime;

import java.util.Observable;
import java.util.Observer;

final class JavaCallWrapper$1
  implements Observer
{
  public void update(Observable o, Object data)
  {
    JavaCallWrapper.access$000(VM.getVM().getTypeDataBase());
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.runtime.JavaCallWrapper.1
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.runtime;

import java.util.Observable;
import java.util.Observer;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.types.AddressField;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.TypeDataBase;

public class JavaCallWrapper
  extends VMObject
{
  protected static AddressField anchorField;
  private static AddressField lastJavaSPField;
  private static AddressField lastJavaPCField;
  
  static
  {
    VM.registerVMInitializedObserver(new Observer()
    {
      public void update(Observable o, Object data)
      {
        JavaCallWrapper.initialize(VM.getVM().getTypeDataBase());
      }
    });
  }
  
  private static synchronized void initialize(TypeDataBase db)
  {
    Type type = db.lookupType("JavaCallWrapper");
    Type anchorType = db.lookupType("JavaFrameAnchor");
    
    anchorField = type.getAddressField("_anchor");
    lastJavaSPField = anchorType.getAddressField("_last_Java_sp");
    lastJavaPCField = anchorType.getAddressField("_last_Java_pc");
  }
  
  public JavaCallWrapper(Address addr)
  {
    super(addr);
  }
  
  public Address getLastJavaSP()
  {
    return lastJavaSPField.getValue(addr.addOffsetTo(anchorField.getOffset()));
  }
  
  public Address getLastJavaPC()
  {
    return lastJavaPCField.getValue(addr.addOffsetTo(anchorField.getOffset()));
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.runtime.JavaCallWrapper
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.runtime;

import java.util.Observable;
import java.util.Observer;

final class JavaThread$1
  implements Observer
{
  public void update(Observable o, Object data)
  {
    JavaThread.access$000(VM.getVM().getTypeDataBase());
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.runtime.JavaThread.1
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.runtime;

import java.io.PrintStream;
import java.util.Observable;
import java.util.Observer;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.ThreadProxy;
import sun.jvm.hotspot.oops.ObjectHeap;
import sun.jvm.hotspot.oops.Oop;
import sun.jvm.hotspot.oops.OopUtilities;
import sun.jvm.hotspot.types.AddressField;
import sun.jvm.hotspot.types.CIntegerField;
import sun.jvm.hotspot.types.OopField;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.TypeDataBase;
import sun.jvm.hotspot.utilities.AddressOps;
import sun.jvm.hotspot.utilities.Assert;

public class JavaThread
  extends Thread
{
  private static final boolean DEBUG = System.getProperty("sun.jvm.hotspot.runtime.JavaThread.DEBUG") != null;
  private static AddressField nextField;
  private static OopField threadObjField;
  private static AddressField anchorField;
  private static AddressField lastJavaSPField;
  private static AddressField lastJavaPCField;
  private static CIntegerField threadStateField;
  private static AddressField osThreadField;
  private static AddressField stackBaseField;
  private static CIntegerField stackSizeField;
  private static JavaThreadPDAccess access;
  private static int UNINITIALIZED;
  private static int NEW;
  private static int NEW_TRANS;
  private static int IN_NATIVE;
  private static int IN_NATIVE_TRANS;
  private static int IN_VM;
  private static int IN_VM_TRANS;
  private static int IN_JAVA;
  private static int IN_JAVA_TRANS;
  private static int BLOCKED;
  private static int BLOCKED_TRANS;
  
  static
  {
    VM.registerVMInitializedObserver(new Observer()
    {
      public void update(Observable o, Object data)
      {
        JavaThread.initialize(VM.getVM().getTypeDataBase());
      }
    });
  }
  
  private static synchronized void initialize(TypeDataBase db)
  {
    Type type = db.lookupType("JavaThread");
    Type anchorType = db.lookupType("JavaFrameAnchor");
    
    nextField = type.getAddressField("_next");
    threadObjField = type.getOopField("_threadObj");
    anchorField = type.getAddressField("_anchor");
    lastJavaSPField = anchorType.getAddressField("_last_Java_sp");
    lastJavaPCField = anchorType.getAddressField("_last_Java_pc");
    threadStateField = type.getCIntegerField("_thread_state");
    osThreadField = type.getAddressField("_osthread");
    stackBaseField = type.getAddressField("_stack_base");
    stackSizeField = type.getCIntegerField("_stack_size");
    
    UNINITIALIZED = db.lookupIntConstant("_thread_uninitialized").intValue();
    NEW = db.lookupIntConstant("_thread_new").intValue();
    NEW_TRANS = db.lookupIntConstant("_thread_new_trans").intValue();
    IN_NATIVE = db.lookupIntConstant("_thread_in_native").intValue();
    IN_NATIVE_TRANS = db.lookupIntConstant("_thread_in_native_trans").intValue();
    IN_VM = db.lookupIntConstant("_thread_in_vm").intValue();
    IN_VM_TRANS = db.lookupIntConstant("_thread_in_vm_trans").intValue();
    IN_JAVA = db.lookupIntConstant("_thread_in_Java").intValue();
    IN_JAVA_TRANS = db.lookupIntConstant("_thread_in_Java_trans").intValue();
    BLOCKED = db.lookupIntConstant("_thread_blocked").intValue();
    BLOCKED_TRANS = db.lookupIntConstant("_thread_blocked_trans").intValue();
  }
  
  public JavaThread(Address addr)
  {
    super(addr);
  }
  
  void setThreadPDAccess(JavaThreadPDAccess access)
  {
    access = access;
  }
  
  public JavaThread next()
  {
    Address threadAddr = nextField.getValue(addr);
    if (threadAddr == null) {
      return null;
    }
    return VM.getVM().getThreads().createJavaThreadWrapper(threadAddr);
  }
  
  public boolean isJavaThread()
  {
    return true;
  }
  
  public static AddressField getAnchorField()
  {
    return anchorField;
  }
  
  public Address getLastJavaSP()
  {
    Address sp = lastJavaSPField.getValue(addr.addOffsetTo(anchorField.getOffset()));
    return sp;
  }
  
  public Address getLastJavaPC()
  {
    Address pc = lastJavaPCField.getValue(addr.addOffsetTo(anchorField.getOffset()));
    return pc;
  }
  
  public Address getLastJavaFP()
  {
    return access.getLastJavaFP(addr);
  }
  
  public Address getBaseOfStackPointer()
  {
    return access.getBaseOfStackPointer(addr);
  }
  
  public boolean hasLastJavaFrame()
  {
    return getLastJavaSP() != null;
  }
  
  public Frame getLastFrame()
  {
    return cookLastFrame(getLastFramePD());
  }
  
  protected Frame getLastFramePD()
  {
    return access.getLastFramePD(this, addr);
  }
  
  public JavaVFrame getLastJavaVFrame(RegisterMap regMap)
  {
    if (Assert.ASSERTS_ENABLED) {
      Assert.that(regMap != null, "a map must be given");
    }
    Frame f = getLastFrame();
    if (f == null) {
      return null;
    }
    for (VFrame vf = VFrame.newVFrame(f, regMap, this); vf != null; vf = vf.sender()) {
      if (vf.isJavaFrame()) {
        return (JavaVFrame)vf;
      }
    }
    return null;
  }
  
  public JavaVFrame getLastJavaVFrameDbg()
  {
    RegisterMap regMap = newRegisterMap(true);
    Frame f = getCurrentFrameGuess();
    if (f == null) {
      return null;
    }
    boolean imprecise = true;
    if ((f.isInterpretedFrame()) && (!f.isInterpretedFrameValid()))
    {
      if (DEBUG) {
        System.out.println("Correcting for invalid interpreter frame");
      }
      f = f.sender(regMap);
      imprecise = false;
    }
    VFrame vf = VFrame.newVFrame(f, regMap, this, true, imprecise);
    if (vf == null)
    {
      if (DEBUG) {
        System.out.println(" (Unable to create vframe for topmost frame guess)");
      }
      return null;
    }
    return vf.isJavaFrame() ? (JavaVFrame)vf : vf.javaSender();
  }
  
  public RegisterMap newRegisterMap(boolean updateMap)
  {
    return access.newRegisterMap(this, updateMap);
  }
  
  public Frame getCurrentFrameGuess()
  {
    return access.getCurrentFrameGuess(this, addr);
  }
  
  public void printThreadIDOn(PrintStream tty)
  {
    access.printThreadIDOn(addr, tty);
  }
  
  public void printThreadID()
  {
    printThreadIDOn(System.out);
  }
  
  public ThreadProxy getThreadProxy()
  {
    return access.getThreadProxy(addr);
  }
  
  public JavaThreadState getThreadState()
  {
    int val = (int)threadStateField.getValue(addr);
    if (val == UNINITIALIZED) {
      return JavaThreadState.UNINITIALIZED;
    }
    if (val == NEW) {
      return JavaThreadState.NEW;
    }
    if (val == NEW_TRANS) {
      return JavaThreadState.NEW_TRANS;
    }
    if (val == IN_NATIVE) {
      return JavaThreadState.IN_NATIVE;
    }
    if (val == IN_NATIVE_TRANS) {
      return JavaThreadState.IN_NATIVE_TRANS;
    }
    if (val == IN_VM) {
      return JavaThreadState.IN_VM;
    }
    if (val == IN_VM_TRANS) {
      return JavaThreadState.IN_VM_TRANS;
    }
    if (val == IN_JAVA) {
      return JavaThreadState.IN_JAVA;
    }
    if (val == IN_JAVA_TRANS) {
      return JavaThreadState.IN_JAVA_TRANS;
    }
    if (val == BLOCKED) {
      return JavaThreadState.BLOCKED;
    }
    if (val == BLOCKED_TRANS) {
      return JavaThreadState.BLOCKED_TRANS;
    }
    throw new RuntimeException("Illegal thread state " + val);
  }
  
  public OSThread getOSThread()
  {
    return (OSThread)VMObjectFactory.newObject(OSThread.class, osThreadField.getValue(addr));
  }
  
  public Address getStackBase()
  {
    return stackBaseField.getValue(addr);
  }
  
  public long getStackSize()
  {
    return stackSizeField.getValue(addr);
  }
  
  public Oop getThreadObj()
  {
    Oop obj = null;
    try
    {
      obj = VM.getVM().getObjectHeap().newOop(threadObjField.getValue(addr));
    }
    catch (Exception e)
    {
      e.printStackTrace();
    }
    return obj;
  }
  
  public String getThreadName()
  {
    Oop threadObj = getThreadObj();
    if (threadObj == null) {
      return "<null>";
    }
    return OopUtilities.threadOopGetName(threadObj);
  }
  
  public void oopsDo(AddressVisitor oopVisitor)
  {
    super.oopsDo(oopVisitor);
    for (StackFrameStream fst = new StackFrameStream(this); !fst.isDone(); fst.next()) {
      fst.getCurrent().oopsDo(oopVisitor, fst.getRegisterMap());
    }
  }
  
  public boolean isInStack(Address a)
  {
    if (Assert.ASSERTS_ENABLED) {
      Assert.that(VM.getVM().isDebugging(), "Not yet implemented for non-debugging system");
    }
    Address sp = lastSPDbg();
    Address stackBase = getStackBase();
    if (sp == null) {
      return false;
    }
    return (stackBase.greaterThanOrEqual(a)) && (sp.lessThanOrEqual(a));
  }
  
  public boolean isLockOwned(Address a)
  {
    Address stackBase = getStackBase();
    Address stackLimit = stackBase.addOffsetTo(-getStackSize());
    
    return (stackBase.greaterThanOrEqual(a)) && (stackLimit.lessThanOrEqual(a));
  }
  
  public Oop getCurrentParkBlocker()
  {
    Oop threadObj = getThreadObj();
    if (threadObj != null) {
      return OopUtilities.threadOopGetParkBlocker(threadObj);
    }
    return null;
  }
  
  public void printInfoOn(PrintStream tty)
  {
    tty.println("State: " + getThreadState().toString());
    
    Frame tmpFrame = getCurrentFrameGuess();
    if (tmpFrame != null)
    {
      Address sp = tmpFrame.getSP();
      Address maxSP = sp;
      Address minSP = sp;
      RegisterMap tmpMap = newRegisterMap(false);
      while ((tmpFrame != null) && (!tmpFrame.isFirstFrame()))
      {
        tmpFrame = tmpFrame.sender(tmpMap);
        if (tmpFrame != null)
        {
          sp = tmpFrame.getSP();
          maxSP = AddressOps.max(maxSP, sp);
          minSP = AddressOps.min(minSP, sp);
        }
      }
      tty.println("Stack in use by Java: " + minSP + " .. " + maxSP);
    }
    else
    {
      tty.println("No Java frames present");
    }
    tty.println("Base of Stack: " + getBaseOfStackPointer());
    tty.println("Last_Java_SP: " + getLastJavaSP());
    tty.println("Last_Java_FP: " + getLastJavaFP());
    tty.println("Last_Java_PC: " + getLastJavaPC());
    
    access.printInfoOn(addr, tty);
  }
  
  private Frame cookLastFrame(Frame fr)
  {
    if (fr == null) {
      return null;
    }
    Address pc = fr.getPC();
    if ((Assert.ASSERTS_ENABLED) && 
      (pc == null)) {
      Assert.that(VM.getVM().isDebugging(), "must have PC");
    }
    return fr;
  }
  
  private Address lastSPDbg()
  {
    return access.getLastSP(addr);
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.runtime.JavaThread
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.runtime;

import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.types.TypeDataBase;

public abstract interface JavaThreadFactory
{
  public abstract JavaThread createJavaThreadWrapper(Address paramAddress, TypeDataBase paramTypeDataBase);
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.runtime.JavaThreadFactory
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.runtime;

import java.io.PrintStream;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.ThreadProxy;

public abstract interface JavaThreadPDAccess
{
  public abstract Address getLastJavaFP(Address paramAddress);
  
  public abstract Address getLastJavaPC(Address paramAddress);
  
  public abstract Address getBaseOfStackPointer(Address paramAddress);
  
  public abstract Frame getLastFramePD(JavaThread paramJavaThread, Address paramAddress);
  
  public abstract RegisterMap newRegisterMap(JavaThread paramJavaThread, boolean paramBoolean);
  
  public abstract Frame getCurrentFrameGuess(JavaThread paramJavaThread, Address paramAddress);
  
  public abstract void printThreadIDOn(Address paramAddress, PrintStream paramPrintStream);
  
  public abstract void printInfoOn(Address paramAddress, PrintStream paramPrintStream);
  
  public abstract Address getLastSP(Address paramAddress);
  
  public abstract ThreadProxy getThreadProxy(Address paramAddress);
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.runtime.JavaThreadPDAccess
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.runtime;

public class JavaThreadState
{
  private String stringVal;
  public static final JavaThreadState UNINITIALIZED = new JavaThreadState("UNINITIALIZED");
  public static final JavaThreadState NEW = new JavaThreadState("NEW");
  public static final JavaThreadState NEW_TRANS = new JavaThreadState("NEW_TRANS");
  public static final JavaThreadState IN_NATIVE = new JavaThreadState("IN_NATIVE");
  public static final JavaThreadState IN_NATIVE_TRANS = new JavaThreadState("IN_NATIVE_TRANS");
  public static final JavaThreadState IN_VM = new JavaThreadState("IN_VM");
  public static final JavaThreadState IN_VM_TRANS = new JavaThreadState("IN_VM_TRANS");
  public static final JavaThreadState IN_JAVA = new JavaThreadState("IN_JAVA");
  public static final JavaThreadState IN_JAVA_TRANS = new JavaThreadState("IN_JAVA_TRANS");
  public static final JavaThreadState BLOCKED = new JavaThreadState("BLOCKED");
  public static final JavaThreadState BLOCKED_TRANS = new JavaThreadState("BLOCKED_TRANS");
  
  private JavaThreadState(String stringVal)
  {
    this.stringVal = stringVal;
  }
  
  public String toString()
  {
    return stringVal;
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.runtime.JavaThreadState
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.runtime;

import java.io.PrintStream;
import java.util.List;
import sun.jvm.hotspot.oops.Method;
import sun.jvm.hotspot.utilities.Assert;

public abstract class JavaVFrame
  extends VFrame
{
  public abstract Method getMethod();
  
  public abstract int getBCI();
  
  public abstract StackValueCollection getLocals();
  
  public abstract StackValueCollection getExpressions();
  
  public abstract List getMonitors();
  
  public boolean isJavaFrame()
  {
    return true;
  }
  
  JavaVFrame(Frame fr, RegisterMap regMap, JavaThread thread)
  {
    super(fr, regMap, thread);
  }
  
  public void print()
  {
    printOn(System.out);
  }
  
  public void printOn(PrintStream tty)
  {
    super.printOn(tty);
    
    tty.print("\t");
    getMethod().printValueOn(tty);
    tty.println();
    tty.println("\tbci:\t" + getBCI());
    
    printStackValuesOn(tty, "locals", getLocals());
    printStackValuesOn(tty, "expressions", getExpressions());
  }
  
  public void printActivation(int index)
  {
    printActivationOn(System.out, index);
  }
  
  public void printActivationOn(PrintStream tty, int index)
  {
    tty.print(index + " - ");
    printValueOn(tty);
    tty.println();
    if (VM.getVM().wizardMode())
    {
      printOn(tty);
      tty.println();
    }
  }
  
  public void verify() {}
  
  public boolean equals(Object o)
  {
    if ((o == null) || (!(o instanceof JavaVFrame))) {
      return false;
    }
    JavaVFrame other = (JavaVFrame)o;
    if (!getMethod().equals(other.getMethod())) {
      return false;
    }
    if (getBCI() != other.getBCI()) {
      return false;
    }
    if (!getFrame().getFP().equals(other.getFrame().getFP())) {
      return false;
    }
    return true;
  }
  
  public int hashCode()
  {
    return getMethod().hashCode() ^ getBCI() ^ getFrame().getFP().hashCode();
  }
  
  public boolean structuralCompare(JavaVFrame other)
  {
    if (!getMethod().equals(other.getMethod())) {
      return false;
    }
    if (getBCI() != other.getBCI()) {
      return false;
    }
    StackValueCollection locs = getLocals();
    StackValueCollection otherLocs = other.getLocals();
    if (Assert.ASSERTS_ENABLED) {
      Assert.that(locs.size() == otherLocs.size(), "sanity check");
    }
    for (int i = 0; i < locs.size(); i++) {
      if (((!isCompiledFrame()) || (locs.get(i).getType() != BasicType.getTConflict())) && (
        (!other.isCompiledFrame()) || (otherLocs.get(i).getType() != BasicType.getTConflict()))) {
        if (!locs.get(i).equals(otherLocs.get(i))) {
          return false;
        }
      }
    }
    StackValueCollection exprs = getExpressions();
    StackValueCollection otherExprs = other.getExpressions();
    if (Assert.ASSERTS_ENABLED) {
      Assert.that(exprs.size() == otherExprs.size(), "sanity check");
    }
    for (int i = 0; i < exprs.size(); i++) {
      if (!exprs.get(i).equals(otherExprs.get(i))) {
        return false;
      }
    }
    return true;
  }
  
  private void printStackValuesOn(PrintStream tty, String title, StackValueCollection values)
  {
    if (values.isEmpty()) {
      return;
    }
    tty.println("\t" + title + ":");
    for (int index = 0; index < values.size(); index++)
    {
      tty.print("\t" + index + "\t");
      values.get(index).printOn(tty);
      tty.println();
    }
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.runtime.JavaVFrame
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.runtime;

import java.util.Observable;
import java.util.Observer;

final class JNIHandleBlock$1
  implements Observer
{
  public void update(Observable o, Object data)
  {
    JNIHandleBlock.access$000(VM.getVM().getTypeDataBase());
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.runtime.JNIHandleBlock.1
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.runtime;

import java.util.Observable;
import java.util.Observer;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.OopHandle;
import sun.jvm.hotspot.memory.Universe;
import sun.jvm.hotspot.types.AddressField;
import sun.jvm.hotspot.types.CIntegerField;
import sun.jvm.hotspot.types.Field;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.TypeDataBase;
import sun.jvm.hotspot.utilities.Assert;

public class JNIHandleBlock
  extends VMObject
{
  private static Field handlesField;
  private static CIntegerField topField;
  private static AddressField nextField;
  private static int blockSizeInOops;
  
  static
  {
    VM.registerVMInitializedObserver(new Observer()
    {
      public void update(Observable o, Object data)
      {
        JNIHandleBlock.initialize(VM.getVM().getTypeDataBase());
      }
    });
  }
  
  private static synchronized void initialize(TypeDataBase db)
  {
    Type type = db.lookupType("JNIHandleBlock");
    
    handlesField = type.getField("_handles");
    topField = type.getCIntegerField("_top");
    nextField = type.getAddressField("_next");
    
    blockSizeInOops = db.lookupIntConstant("JNIHandleBlock::block_size_in_oops").intValue();
  }
  
  public JNIHandleBlock(Address addr)
  {
    super(addr);
  }
  
  public JNIHandleBlock next()
  {
    Address handleAddr = nextField.getValue(addr);
    if (handleAddr == null) {
      return null;
    }
    if (top() < blockSizeInOops) {
      return null;
    }
    return new JNIHandleBlock(handleAddr);
  }
  
  public int top()
  {
    return (int)topField.getValue(addr);
  }
  
  public void oopsDo(AddressVisitor visitor)
  {
    for (int i = 0; i < top(); i++)
    {
      Address cur = getOopHandleAddress(i);
      if (cur != null) {
        visitor.visitAddress(cur);
      }
    }
    JNIHandleBlock n = next();
    if (n != null) {
      n.oopsDo(visitor);
    }
  }
  
  public OopHandle getOopHandle(int x)
  {
    Address oopAddr = getOopHandleAddress(x);
    if (oopAddr != null) {
      return oopAddr.getOopHandleAt(0L);
    }
    return null;
  }
  
  public JNIHandleBlock blockContainingHandle(Address jniHandle)
  {
    JNIHandleBlock cur = this;
    while (cur != null)
    {
      if (indexOfHandle(jniHandle) >= 0) {
        return cur;
      }
      cur = cur.next();
    }
    return null;
  }
  
  public int indexOfHandle(Address jniHandle)
  {
    for (int i = 0; i < top(); i++)
    {
      Address addr = getOopHandleAddress(i);
      if ((addr != null) && 
        (addr.equals(jniHandle))) {
        return i;
      }
    }
    return -1;
  }
  
  public String toString()
  {
    Address handleBase = addr.addOffsetTo(handlesField.getOffset());
    Address handleEnd = addr.addOffsetTo(handlesField.getOffset() + top() * VM.getVM().getOopSize());
    return "JNIHandleBlock [" + handleBase + ", " + handleEnd + ")";
  }
  
  private Address getOopHandleAddress(int x)
  {
    if (Assert.ASSERTS_ENABLED) {
      Assert.that(x < top(), "out of bounds");
    }
    Address oopAddr = addr.addOffsetTo(handlesField.getOffset() + x * VM.getVM().getOopSize());
    OopHandle handle = oopAddr.getOopHandleAt(0L);
    if ((VM.getVM().getUniverse().isInReserved(handle)) && (!VM.getVM().getJNIHandles().isDeletedHandle(handle))) {
      return oopAddr;
    }
    return null;
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.runtime.JNIHandleBlock
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.runtime;

import java.util.Observable;
import java.util.Observer;

final class JNIHandles$1
  implements Observer
{
  public void update(Observable o, Object data)
  {
    JNIHandles.access$000(VM.getVM().getTypeDataBase());
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.runtime.JNIHandles.1
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.runtime;

import java.util.Observable;
import java.util.Observer;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.OopHandle;
import sun.jvm.hotspot.types.AddressField;
import sun.jvm.hotspot.types.OopField;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.TypeDataBase;

public class JNIHandles
{
  private static AddressField globalHandlesField;
  private static AddressField weakGlobalHandlesField;
  private static OopField deletedHandleField;
  
  static
  {
    VM.registerVMInitializedObserver(new Observer()
    {
      public void update(Observable o, Object data)
      {
        JNIHandles.initialize(VM.getVM().getTypeDataBase());
      }
    });
  }
  
  private static synchronized void initialize(TypeDataBase db)
  {
    Type type = db.lookupType("JNIHandles");
    
    globalHandlesField = type.getAddressField("_global_handles");
    weakGlobalHandlesField = type.getAddressField("_weak_global_handles");
    deletedHandleField = type.getOopField("_deleted_handle");
  }
  
  public JNIHandleBlock globalHandles()
  {
    Address handleAddr = globalHandlesField.getValue();
    if (handleAddr == null) {
      return null;
    }
    return new JNIHandleBlock(handleAddr);
  }
  
  public JNIHandleBlock weakGlobalHandles()
  {
    Address handleAddr = weakGlobalHandlesField.getValue();
    if (handleAddr == null) {
      return null;
    }
    return new JNIHandleBlock(handleAddr);
  }
  
  public OopHandle deletedHandle()
  {
    return deletedHandleField.getValue();
  }
  
  public boolean isDeletedHandle(OopHandle handle)
  {
    return (handle != null) && (handle.equals(deletedHandle()));
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.runtime.JNIHandles
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.runtime;

import java.util.Observable;
import java.util.Observer;

final class JNIid$1
  implements Observer
{
  public void update(Observable o, Object data)
  {
    JNIid.access$000(VM.getVM().getTypeDataBase());
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.runtime.JNIid.1
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.runtime;

import java.util.Observable;
import java.util.Observer;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.oops.InstanceKlass;
import sun.jvm.hotspot.oops.Klass;
import sun.jvm.hotspot.oops.Method;
import sun.jvm.hotspot.oops.ObjArray;
import sun.jvm.hotspot.oops.ObjectHeap;
import sun.jvm.hotspot.types.AddressField;
import sun.jvm.hotspot.types.CIntegerField;
import sun.jvm.hotspot.types.OopField;
import sun.jvm.hotspot.types.TypeDataBase;

public class JNIid
  extends VMObject
{
  private static OopField holder;
  private static AddressField next;
  private static CIntegerField offset;
  private static OopField resolvedMethod;
  private static OopField resolvedReceiver;
  private ObjectHeap heap;
  
  static
  {
    VM.registerVMInitializedObserver(new Observer()
    {
      public void update(Observable o, Object data)
      {
        JNIid.initialize(VM.getVM().getTypeDataBase());
      }
    });
  }
  
  public JNIid(Address addr, ObjectHeap heap)
  {
    super(addr);
    this.heap = heap;
  }
  
  public JNIid next()
  {
    Address nextAddr = next.getValue(addr);
    if (nextAddr == null) {
      return null;
    }
    return new JNIid(nextAddr, heap);
  }
  
  public Klass holder()
  {
    return (Klass)heap.newOop(holder.getValue(addr));
  }
  
  public int offset()
  {
    return (int)offset.getValue(addr);
  }
  
  public Method method()
  {
    return (Method)((InstanceKlass)holder()).getMethods().getObjAt(offset());
  }
  
  public Method resolvedMethod()
  {
    return (Method)heap.newOop(resolvedMethod.getValue(addr));
  }
  
  public Klass resolvedReceiver()
  {
    return (Klass)heap.newOop(resolvedReceiver.getValue(addr));
  }
  
  private static synchronized void initialize(TypeDataBase db) {}
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.runtime.JNIid
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.runtime;

import sun.jvm.hotspot.debugger.Address;

public class JvmtiAgentThread
  extends JavaThread
{
  public JvmtiAgentThread(Address addr)
  {
    super(addr);
  }
  
  public boolean isJavaThread()
  {
    return false;
  }
  
  public boolean isJvmtiAgentThread()
  {
    return true;
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.runtime.JvmtiAgentThread
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.runtime.linux;

public class LinuxSignals
{
  private static String[] signalNames = { "", "SIGHUP", "SIGINT", "SIGQUIT", "SIGILL", "SIGTRAP", "SIGABRT", "SIGIOT", "SIGBUS", "SIGFPE", "SIGKILL", "SIGUSR1", "SIGSEGV", "SIGUSR2", "SIGPIPE", "SIGALRM", "SIGTERM", "SIGSTKFLT", "SIGCHLD", "SIGCONT", "SIGSTOP", "SIGTSTP", "SIGTTIN", "SIGTTOU", "SIGURG", "SIGXCPU", "SIGXFSZ", "SIGVTALRM", "SIGPROF", "SIGWINCH", "SIGPOLL", "SIGPWR", "SIGSYS" };
  
  public static String getSignalName(int sigNum)
  {
    if ((sigNum <= 0) || (sigNum >= signalNames.length)) {
      return "<Error: Illegal signal number " + sigNum + ">";
    }
    return signalNames[sigNum];
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.runtime.linux.LinuxSignals
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.runtime.linux_amd64;

import java.util.Observable;
import java.util.Observer;
import sun.jvm.hotspot.runtime.VM;

final class LinuxAMD64JavaThreadPDAccess$1
  implements Observer
{
  public void update(Observable o, Object data)
  {
    LinuxAMD64JavaThreadPDAccess.access$000(VM.getVM().getTypeDataBase());
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.runtime.linux_amd64.LinuxAMD64JavaThreadPDAccess.1
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.runtime.linux_amd64;

import java.io.PrintStream;
import java.util.Observable;
import java.util.Observer;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.JVMDebugger;
import sun.jvm.hotspot.debugger.ThreadProxy;
import sun.jvm.hotspot.debugger.amd64.AMD64ThreadContext;
import sun.jvm.hotspot.runtime.Frame;
import sun.jvm.hotspot.runtime.JavaThread;
import sun.jvm.hotspot.runtime.JavaThreadPDAccess;
import sun.jvm.hotspot.runtime.RegisterMap;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.runtime.amd64.AMD64CurrentFrameGuess;
import sun.jvm.hotspot.runtime.amd64.AMD64Frame;
import sun.jvm.hotspot.runtime.amd64.AMD64RegisterMap;
import sun.jvm.hotspot.types.AddressField;
import sun.jvm.hotspot.types.CIntegerField;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.TypeDataBase;

public class LinuxAMD64JavaThreadPDAccess
  implements JavaThreadPDAccess
{
  private static AddressField lastJavaFPField;
  private static AddressField osThreadField;
  private static CIntegerField osThreadThreadIDField;
  private static final long GUESS_SCAN_RANGE = 131072L;
  
  static
  {
    VM.registerVMInitializedObserver(new Observer()
    {
      public void update(Observable o, Object data)
      {
        LinuxAMD64JavaThreadPDAccess.initialize(VM.getVM().getTypeDataBase());
      }
    });
  }
  
  private static synchronized void initialize(TypeDataBase db)
  {
    Type type = db.lookupType("JavaThread");
    osThreadField = type.getAddressField("_osthread");
    
    Type anchorType = db.lookupType("JavaFrameAnchor");
    lastJavaFPField = anchorType.getAddressField("_last_Java_fp");
    
    Type osThreadType = db.lookupType("OSThread");
    osThreadThreadIDField = osThreadType.getCIntegerField("_thread_id");
  }
  
  public Address getLastJavaFP(Address addr)
  {
    return lastJavaFPField.getValue(addr.addOffsetTo(JavaThread.getAnchorField().getOffset()));
  }
  
  public Address getLastJavaPC(Address addr)
  {
    return null;
  }
  
  public Address getBaseOfStackPointer(Address addr)
  {
    return null;
  }
  
  public Frame getLastFramePD(JavaThread thread, Address addr)
  {
    Address fp = thread.getLastJavaFP();
    if (fp == null) {
      return null;
    }
    return new AMD64Frame(thread.getLastJavaSP(), fp);
  }
  
  public RegisterMap newRegisterMap(JavaThread thread, boolean updateMap)
  {
    return new AMD64RegisterMap(thread, updateMap);
  }
  
  public Frame getCurrentFrameGuess(JavaThread thread, Address addr)
  {
    ThreadProxy t = getThreadProxy(addr);
    AMD64ThreadContext context = (AMD64ThreadContext)t.getContext();
    AMD64CurrentFrameGuess guesser = new AMD64CurrentFrameGuess(context, thread);
    if (!guesser.run(131072L)) {
      return null;
    }
    if (guesser.getPC() == null) {
      return new AMD64Frame(guesser.getSP(), guesser.getFP());
    }
    return new AMD64Frame(guesser.getSP(), guesser.getFP(), guesser.getPC());
  }
  
  public void printThreadIDOn(Address addr, PrintStream tty)
  {
    tty.print(getThreadProxy(addr));
  }
  
  public void printInfoOn(Address threadAddr, PrintStream tty)
  {
    tty.print("Thread id: ");
    printThreadIDOn(threadAddr, tty);
  }
  
  public Address getLastSP(Address addr)
  {
    ThreadProxy t = getThreadProxy(addr);
    AMD64ThreadContext context = (AMD64ThreadContext)t.getContext();
    return context.getRegisterAsAddress(20);
  }
  
  public ThreadProxy getThreadProxy(Address addr)
  {
    Address osThreadAddr = osThreadField.getValue(addr);
    
    Address threadIdAddr = osThreadAddr.addOffsetTo(osThreadThreadIDField.getOffset());
    
    JVMDebugger debugger = VM.getVM().getDebugger();
    return debugger.getThreadForIdentifierAddress(threadIdAddr);
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.runtime.linux_amd64.LinuxAMD64JavaThreadPDAccess
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.runtime.linux_ia64;

import java.util.Observable;
import java.util.Observer;
import sun.jvm.hotspot.runtime.VM;

final class LinuxIA64JavaThreadPDAccess$1
  implements Observer
{
  public void update(Observable o, Object data)
  {
    LinuxIA64JavaThreadPDAccess.access$000(VM.getVM().getTypeDataBase());
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.runtime.linux_ia64.LinuxIA64JavaThreadPDAccess.1
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.runtime.linux_ia64;

import java.io.PrintStream;
import java.util.Observable;
import java.util.Observer;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.JVMDebugger;
import sun.jvm.hotspot.debugger.ThreadProxy;
import sun.jvm.hotspot.debugger.ia64.IA64ThreadContext;
import sun.jvm.hotspot.runtime.Frame;
import sun.jvm.hotspot.runtime.JavaThread;
import sun.jvm.hotspot.ru
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2019. Infinite Loop Ltd