sa-jdi

rows UnmappedAddressException, UnalignedAddressException;
  
  public abstract short getJShortAt(long paramLong)
    throws UnmappedAddressException, UnalignedAddressException;
  
  public abstract OopHandle getOopHandleAt(long paramLong)
    throws UnmappedAddressException, UnalignedAddressException, NotInHeapException;
  
  public abstract OopHandle getCompOopHandleAt(long paramLong)
    throws UnmappedAddressException, UnalignedAddressException, NotInHeapException;
  
  public abstract void setCIntegerAt(long paramLong1, long paramLong2, long paramLong3);
  
  public abstract void setAddressAt(long paramLong, Address paramAddress);
  
  public abstract void setJBooleanAt(long paramLong, boolean paramBoolean)
    throws UnmappedAddressException, UnalignedAddressException;
  
  public abstract void setJByteAt(long paramLong, byte paramByte)
    throws UnmappedAddressException, UnalignedAddressException;
  
  public abstract void setJCharAt(long paramLong, char paramChar)
    throws UnmappedAddressException, UnalignedAddressException;
  
  public abstract void setJDoubleAt(long paramLong, double paramDouble)
    throws UnmappedAddressException, UnalignedAddressException;
  
  public abstract void setJFloatAt(long paramLong, float paramFloat)
    throws UnmappedAddressException, UnalignedAddressException;
  
  public abstract void setJIntAt(long paramLong, int paramInt)
    throws UnmappedAddressException, UnalignedAddressException;
  
  public abstract void setJLongAt(long paramLong1, long paramLong2)
    throws UnmappedAddressException, UnalignedAddressException;
  
  public abstract void setJShortAt(long paramLong, short paramShort)
    throws UnmappedAddressException, UnalignedAddressException;
  
  public abstract void setOopHandleAt(long paramLong, OopHandle paramOopHandle)
    throws UnmappedAddressException, UnalignedAddressException;
  
  public abstract Address addOffsetTo(long paramLong)
    throws UnsupportedOperationException;
  
  public abstract OopHandle addOffsetToAsOopHandle(long paramLong)
    throws UnsupportedOperationException;
  
  public abstract long minus(Address paramAddress);
  
  public abstract boolean lessThan(Address paramAddress);
  
  public abstract boolean lessThanOrEqual(Address paramAddress);
  
  public abstract boolean greaterThan(Address paramAddress);
  
  public abstract boolean greaterThanOrEqual(Address paramAddress);
  
  public abstract Address andWithMask(long paramLong)
    throws UnsupportedOperationException;
  
  public abstract Address orWithMask(long paramLong)
    throws UnsupportedOperationException;
  
  public abstract Address xorWithMask(long paramLong)
    throws UnsupportedOperationException;
}

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

public class AddressException
  extends RuntimeException
{
  private long addr;
  
  public AddressException(long addr)
  {
    this.addr = addr;
  }
  
  public AddressException(String detail, long addr)
  {
    super(detail);
    this.addr = addr;
  }
  
  public long getAddress()
  {
    return addr;
  }
}

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

import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.ThreadContext;

public abstract class AMD64ThreadContext
  implements ThreadContext
{
  public static final int R15 = 0;
  public static final int R14 = 1;
  public static final int R13 = 2;
  public static final int R12 = 3;
  public static final int R11 = 4;
  public static final int R10 = 5;
  public static final int R9 = 6;
  public static final int R8 = 7;
  public static final int RDI = 8;
  public static final int RSI = 9;
  public static final int RBP = 10;
  public static final int RBX = 11;
  public static final int RDX = 12;
  public static final int RCX = 13;
  public static final int RAX = 14;
  public static final int TRAPNO = 15;
  public static final int ERR = 16;
  public static final int RIP = 17;
  public static final int CS = 18;
  public static final int RFL = 19;
  public static final int RSP = 20;
  public static final int SS = 21;
  public static final int FS = 22;
  public static final int GS = 23;
  public static final int ES = 24;
  public static final int DS = 25;
  public static final int FSBASE = 26;
  public static final int GSBASE = 27;
  public static final int NPRGREG = 28;
  private static final String[] regNames = { "r15", "r14", "r13", "r12", "r11", "r10", "r9", "r8", "rdi", "rsi", "rbp", "rbx", "rdx", "rcx", "rax", "trapno", "err", "rip", "cs", "rfl", "rsp", "ss", "fs", "gs", "es", "ds", "fsbase", "gsbase" };
  private long[] data;
  
  public AMD64ThreadContext()
  {
    data = new long[28];
  }
  
  public int getNumRegisters()
  {
    return 28;
  }
  
  public String getRegisterName(int index)
  {
    return regNames[index];
  }
  
  public void setRegister(int index, long value)
  {
    data[index] = value;
  }
  
  public long getRegister(int index)
  {
    return data[index];
  }
  
  public abstract void setRegisterAsAddress(int paramInt, Address paramAddress);
  
  public abstract Address getRegisterAsAddress(int paramInt);
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.debugger.amd64.AMD64ThreadContext
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.debugger.cdbg;

public abstract interface AccessControl
{
  public static final int NO_PROTECTION = 0;
  public static final int PRIVATE = 1;
  public static final int PROTECTED = 2;
  public static final int PUBLIC = 3;
}

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

public abstract interface ArrayType
  extends Type
{
  public abstract Type getElementType();
  
  public abstract int getLength();
}

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

public abstract interface BaseClass
{
  public abstract int getAccessControl();
  
  public abstract boolean isVirtual();
  
  public abstract Type getType();
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.debugger.cdbg.BaseClass
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.debugger.cdbg.basic.amd64;

import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.ThreadProxy;
import sun.jvm.hotspot.debugger.amd64.AMD64ThreadContext;
import sun.jvm.hotspot.debugger.cdbg.CDebugger;
import sun.jvm.hotspot.debugger.cdbg.CFrame;
import sun.jvm.hotspot.debugger.cdbg.basic.BasicCFrame;

public class AMD64CFrame
  extends BasicCFrame
{
  private Address rbp;
  private Address pc;
  private static final int ADDRESS_SIZE = 8;
  
  public AMD64CFrame(CDebugger dbg, Address rbp, Address pc)
  {
    super(dbg);
    this.rbp = rbp;
    this.pc = pc;
  }
  
  public CFrame sender(ThreadProxy thread)
  {
    AMD64ThreadContext context = (AMD64ThreadContext)thread.getContext();
    Address rsp = context.getRegisterAsAddress(20);
    if ((rbp == null) || (rbp.lessThan(rsp))) {
      return null;
    }
    Address nextRBP = rbp.getAddressAt(0L);
    if (nextRBP == null) {
      return null;
    }
    Address nextPC = rbp.getAddressAt(8L);
    if (nextPC == null) {
      return null;
    }
    return new AMD64CFrame(dbg(), nextRBP, nextPC);
  }
  
  public Address pc()
  {
    return pc;
  }
  
  public Address localVariableBase()
  {
    return rbp;
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.debugger.cdbg.basic.amd64.AMD64CFrame
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.debugger.cdbg.basic;

import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.cdbg.ArrayType;
import sun.jvm.hotspot.debugger.cdbg.FieldIdentifier;
import sun.jvm.hotspot.debugger.cdbg.ObjectVisitor;
import sun.jvm.hotspot.debugger.cdbg.Type;
import sun.jvm.hotspot.debugger.cdbg.TypeVisitor;

public class BasicArrayType
  extends BasicType
  implements ArrayType
{
  private Type elementType;
  private int length;
  
  public BasicArrayType(String name, Type elementType, int sizeInBytes)
  {
    this(name, elementType, sizeInBytes, 0, 0);
  }
  
  private BasicArrayType(String name, Type elementType, int sizeInBytes, int length, int cvAttributes)
  {
    super(name, sizeInBytes, cvAttributes);
    this.elementType = elementType;
    this.length = length;
  }
  
  public ArrayType asArray()
  {
    return this;
  }
  
  public Type getElementType()
  {
    return elementType;
  }
  
  public int getLength()
  {
    return length;
  }
  
  Type resolveTypes(BasicCDebugInfoDataBase db, ResolveListener listener)
  {
    super.resolveTypes(db, listener);
    elementType = db.resolveType(this, elementType, listener, "resolving array element type");
    if (!((BasicType)elementType).isLazy()) {
      length = (getSize() / elementType.getSize());
    }
    return this;
  }
  
  public void iterateObject(Address a, ObjectVisitor v, FieldIdentifier f)
  {
    if (f == null)
    {
      v.enterType(this, a);
      for (int i = 0; i < getLength(); i++) {
        ((BasicType)getElementType()).iterateObject(a.addOffsetTo(i * getElementType().getSize()), v, new BasicIndexableFieldIdentifier(getElementType(), i));
      }
      v.exitType();
    }
    else
    {
      v.doArray(f, a);
    }
  }
  
  protected Type createCVVariant(int cvAttributes)
  {
    return new BasicArrayType(getName(), getElementType(), getSize(), getLength(), cvAttributes);
  }
  
  public void visit(TypeVisitor v)
  {
    v.doArrayType(this);
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.debugger.cdbg.basic.BasicArrayType
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.debugger.cdbg.basic;

import sun.jvm.hotspot.debugger.cdbg.BaseClass;
import sun.jvm.hotspot.debugger.cdbg.Type;

public class BasicBaseClass
  implements BaseClass
{
  private int accessControl;
  private boolean isVirtual;
  private Type type;
  
  public BasicBaseClass(int accessControl, boolean isVirtual, Type type)
  {
    this.accessControl = accessControl;
    this.isVirtual = isVirtual;
    this.type = type;
  }
  
  public int getAccessControl()
  {
    return accessControl;
  }
  
  public boolean isVirtual()
  {
    return isVirtual;
  }
  
  public Type getType()
  {
    return type;
  }
  
  public void resolveTypes(Type containingType, BasicCDebugInfoDataBase db, ResolveListener listener)
  {
    type = db.resolveType(containingType, type, listener, "resolving base class");
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.debugger.cdbg.basic.BasicBaseClass
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.debugger.cdbg.basic;

import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.cdbg.BitType;
import sun.jvm.hotspot.debugger.cdbg.FieldIdentifier;
import sun.jvm.hotspot.debugger.cdbg.IntType;
import sun.jvm.hotspot.debugger.cdbg.ObjectVisitor;
import sun.jvm.hotspot.debugger.cdbg.Type;
import sun.jvm.hotspot.debugger.cdbg.TypeVisitor;
import sun.jvm.hotspot.utilities.Assert;

public class BasicBitType
  extends BasicIntType
  implements BitType
{
  private Type underlyingType;
  private int sizeInBits;
  private int offset;
  
  public BasicBitType(Type underlyingType, int sizeInBits, int lsbOffset)
  {
    this(underlyingType, sizeInBits, lsbOffset, 0);
  }
  
  private BasicBitType(Type underlyingType, int sizeInBits, int lsbOffset, int cvAttributes)
  {
    super(null, 0, false, cvAttributes);
    this.underlyingType = underlyingType;
    this.sizeInBits = sizeInBits;
    offset = lsbOffset;
  }
  
  public BitType asBit()
  {
    return this;
  }
  
  public int getSize()
  {
    return underlyingType.getSize();
  }
  
  public boolean isUnsigned()
  {
    if (underlyingType.isInt()) {
      return ((IntType)underlyingType).isUnsigned();
    }
    return false;
  }
  
  public int getSizeInBits()
  {
    return sizeInBits;
  }
  
  public int getOffset()
  {
    return offset;
  }
  
  Type resolveTypes(BasicCDebugInfoDataBase db, ResolveListener listener)
  {
    super.resolveTypes(db, listener);
    underlyingType = db.resolveType(this, underlyingType, listener, "resolving bit type");
    setName(underlyingType.getName());
    if (Assert.ASSERTS_ENABLED)
    {
      BasicType b = (BasicType)underlyingType;
      Assert.that((b.isLazy()) || (b.isInt()), "Underlying type of bitfield must be integer type (or unresolved due to error)");
    }
    return this;
  }
  
  public void iterateObject(Address a, ObjectVisitor v, FieldIdentifier f)
  {
    long mask = maskFor(sizeInBits);
    long val = a.getCIntegerAt(0L, getSize(), isUnsigned()) >> getOffset() & mask;
    if ((!isUnsigned()) && 
      ((val & highBit(sizeInBits)) != 0L)) {
      val |= mask ^ 0xFFFFFFFFFFFFFFFF;
    }
    v.doBit(f, val);
  }
  
  protected Type createCVVariant(int cvAttributes)
  {
    return new BasicBitType(underlyingType, getSizeInBits(), getOffset(), cvAttributes);
  }
  
  public void visit(TypeVisitor v)
  {
    v.doBitType(this);
  }
  
  private static long maskFor(int sizeInBits)
  {
    return (1 << sizeInBits) - 1;
  }
  
  private static long highBit(int sizeInBits)
  {
    return 1 << sizeInBits - 1;
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.debugger.cdbg.basic.BasicBitType
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.debugger.cdbg.basic;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.cdbg.BlockSym;
import sun.jvm.hotspot.debugger.cdbg.LocalSym;

public class BasicBlockSym
  extends BasicSym
  implements BlockSym
{
  private BlockSym parent;
  private long length;
  private Address addr;
  private List locals;
  
  public BasicBlockSym(BlockSym parent, long length, Address addr, String name)
  {
    super(name);
    this.parent = parent;
    this.length = length;
    this.addr = addr;
  }
  
  public BlockSym asBlock()
  {
    return this;
  }
  
  public BlockSym getParent()
  {
    return parent;
  }
  
  public long getLength()
  {
    return length;
  }
  
  public Address getAddress()
  {
    return addr;
  }
  
  public int getNumLocals()
  {
    if (locals == null) {
      return 0;
    }
    return locals.size();
  }
  
  public LocalSym getLocal(int i)
  {
    return (LocalSym)locals.get(i);
  }
  
  public void addLocal(LocalSym local)
  {
    if (locals == null) {
      locals = new ArrayList();
    }
    locals.add(local);
  }
  
  public void resolve(BasicCDebugInfoDataBase db, ResolveListener listener)
  {
    parent = ((BlockSym)db.resolveSym(this, parent, listener, "resolving parent of block"));
    Iterator iter;
    if (locals != null) {
      for (iter = locals.iterator(); iter.hasNext();) {
        ((BasicLocalSym)iter.next()).resolve(db, listener);
      }
    }
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.debugger.cdbg.basic.BasicBlockSym
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.debugger.cdbg.basic;

import java.util.Comparator;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.cdbg.BlockSym;
import sun.jvm.hotspot.utilities.AddressOps;

final class BasicCDebugInfoDataBase$1
  implements Comparator
{
  private final BasicCDebugInfoDataBase this$0;
  
  BasicCDebugInfoDataBase$1(BasicCDebugInfoDataBase paramBasicCDebugInfoDataBase) {}
  
  public int compare(Object o1, Object o2)
  {
    BlockSym b1 = (BlockSym)o1;
    BlockSym b2 = (BlockSym)o2;
    Address a1 = b1.getAddress();
    Address a2 = b2.getAddress();
    if (AddressOps.lt(a1, a2)) {
      return -1;
    }
    if (AddressOps.gt(a1, a2)) {
      return 1;
    }
    return 0;
  }
}

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

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.DebuggerException;
import sun.jvm.hotspot.debugger.cdbg.BlockSym;
import sun.jvm.hotspot.debugger.cdbg.CDebugInfoDataBase;
import sun.jvm.hotspot.debugger.cdbg.GlobalSym;
import sun.jvm.hotspot.debugger.cdbg.LineNumberInfo;
import sun.jvm.hotspot.debugger.cdbg.LineNumberVisitor;
import sun.jvm.hotspot.debugger.cdbg.Sym;
import sun.jvm.hotspot.debugger.cdbg.Type;
import sun.jvm.hotspot.debugger.cdbg.TypeVisitor;
import sun.jvm.hotspot.utilities.AddressOps;
import sun.jvm.hotspot.utilities.Assert;

public class BasicCDebugInfoDataBase
  implements CDebugInfoDataBase
{
  private static final int INITIALIZED_STATE = 0;
  private static final int CONSTRUCTION_STATE = 1;
  private static final int RESOLVED_STATE = 2;
  private static final int COMPLETE_STATE = 3;
  private int state = 0;
  private Map lazyTypeMap;
  private List types;
  private Map nameToTypeMap;
  private Map lazySymMap;
  private List blocks;
  private Map nameToSymMap;
  private BasicLineNumberMapping lineNumbers;
  
  public void beginConstruction()
  {
    if (Assert.ASSERTS_ENABLED) {
      Assert.that(state == 0, "wrong state");
    }
    state = 1;
    
    lazyTypeMap = new HashMap();
    types = new ArrayList();
    
    lazySymMap = new HashMap();
    blocks = new ArrayList();
    nameToSymMap = new HashMap();
    
    lineNumbers = new BasicLineNumberMapping();
  }
  
  public void addType(Object lazyKey, Type type)
  {
    if (Assert.ASSERTS_ENABLED) {
      Assert.that(state == 1, "wrong state");
    }
    if (lazyKey != null)
    {
      if (lazyTypeMap.put(lazyKey, type) != null) {
        throw new RuntimeException("Type redefined for lazy key " + lazyKey);
      }
    }
    else {
      types.add(type);
    }
  }
  
  public void resolve(ResolveListener listener)
  {
    if (Assert.ASSERTS_ENABLED) {
      Assert.that(state == 1, "wrong state");
    }
    resolveLazyMap(listener);
    for (ListIterator iter = types.listIterator(); iter.hasNext();)
    {
      BasicType t = (BasicType)iter.next();
      BasicType t2 = (BasicType)t.resolveTypes(this, listener);
      if (t != t2) {
        iter.set(t2);
      }
    }
    for (Iterator iter = blocks.iterator(); iter.hasNext();) {
      ((BasicSym)iter.next()).resolve(this, listener);
    }
    for (Iterator iter = nameToSymMap.values().iterator(); iter.hasNext();) {
      ((BasicSym)iter.next()).resolve(this, listener);
    }
    Collections.sort(blocks, new Comparator()
    {
      public int compare(Object o1, Object o2)
      {
        BlockSym b1 = (BlockSym)o1;
        BlockSym b2 = (BlockSym)o2;
        Address a1 = b1.getAddress();
        Address a2 = b2.getAddress();
        if (AddressOps.lt(a1, a2)) {
          return -1;
        }
        if (AddressOps.gt(a1, a2)) {
          return 1;
        }
        return 0;
      }
    });
    state = 2;
  }
  
  public void endConstruction()
  {
    if (Assert.ASSERTS_ENABLED) {
      Assert.that(state == 2, "wrong state");
    }
    for (Iterator iter = lazyTypeMap.values().iterator(); iter.hasNext();) {
      types.add(iter.next());
    }
    nameToTypeMap = new HashMap();
    for (Iterator iter = types.iterator(); iter.hasNext();)
    {
      Type t = (Type)iter.next();
      if ((!t.isConst()) && (!t.isVolatile())) {
        nameToTypeMap.put(t.getName(), t);
      }
    }
    lazyTypeMap = null;
    lazySymMap = null;
    
    lineNumbers.sort();
    
    lineNumbers.recomputeEndPCs();
    
    state = 3;
  }
  
  public Type lookupType(String name)
  {
    return lookupType(name, 0);
  }
  
  public Type lookupType(String name, int cvAttributes)
  {
    if (Assert.ASSERTS_ENABLED) {
      Assert.that(state == 3, "wrong state");
    }
    BasicType t = (BasicType)nameToTypeMap.get(name);
    if ((t != null) && 
      (cvAttributes != 0)) {
      t = (BasicType)t.getCVVariant(cvAttributes);
    }
    return t;
  }
  
  public void iterate(TypeVisitor v)
  {
    if (Assert.ASSERTS_ENABLED) {
      Assert.that(state == 3, "wrong state");
    }
    for (Iterator iter = types.iterator(); iter.hasNext();)
    {
      BasicType t = (BasicType)iter.next();
      t.visit(v);
    }
  }
  
  public void addBlock(Object key, BlockSym block)
  {
    if (Assert.ASSERTS_ENABLED) {
      Assert.that(key != null, "key must be non-null");
    }
    lazySymMap.put(key, block);
    blocks.add(block);
  }
  
  public void addGlobalSym(GlobalSym sym)
  {
    nameToSymMap.put(sym.getName(), sym);
  }
  
  public BlockSym debugInfoForPC(Address pc)
  {
    return searchBlocks(pc, 0, blocks.size() - 1);
  }
  
  public GlobalSym lookupSym(String name)
  {
    return (GlobalSym)nameToSymMap.get(name);
  }
  
  public void addLineNumberInfo(BasicLineNumberInfo info)
  {
    lineNumbers.addLineNumberInfo(info);
  }
  
  public LineNumberInfo lineNumberForPC(Address pc)
    throws DebuggerException
  {
    return lineNumbers.lineNumberForPC(pc);
  }
  
  public void iterate(LineNumberVisitor v)
  {
    lineNumbers.iterate(v);
  }
  
  public Type resolveType(Type containingType, Type targetType, ResolveListener listener, String detail)
  {
    BasicType basicTargetType = (BasicType)targetType;
    if (Assert.ASSERTS_ENABLED) {
      Assert.that(state == 1, "wrong state");
    }
    if (basicTargetType.isLazy())
    {
      BasicType resolved = (BasicType)lazyTypeMap.get(((LazyType)targetType).getKey());
      if (resolved == null)
      {
        listener.resolveFailed(containingType, (LazyType)targetType, detail + " because target type was not found");
        return targetType;
      }
      if (resolved.isLazy())
      {
        if ((resolved.isConst()) || (resolved.isVolatile())) {
          resolved = (BasicType)resolved.resolveTypes(this, listener);
        }
        if (resolved.isLazy()) {
          listener.resolveFailed(containingType, (LazyType)targetType, detail + " because target type (with key " + ((Integer)((LazyType)resolved).getKey()).intValue() + (resolved.isConst() ? ", const" : ", not const") + (resolved.isVolatile() ? ", volatile" : ", not volatile") + ") was lazy");
        }
      }
      return resolved;
    }
    return targetType;
  }
  
  public Type resolveType(Sym containingSymbol, Type targetType, ResolveListener listener, String detail)
  {
    BasicType basicTargetType = (BasicType)targetType;
    if (Assert.ASSERTS_ENABLED) {
      Assert.that(state == 1, "wrong state");
    }
    if (basicTargetType.isLazy())
    {
      BasicType resolved = (BasicType)lazyTypeMap.get(((LazyType)targetType).getKey());
      if (resolved == null)
      {
        listener.resolveFailed(containingSymbol, (LazyType)targetType, detail);
        return targetType;
      }
      if (resolved.isLazy())
      {
        if ((resolved.isConst()) || (resolved.isVolatile())) {
          resolved = (BasicType)resolved.resolveTypes(this, listener);
        }
        if (resolved.isLazy()) {
          listener.resolveFailed(containingSymbol, (LazyType)targetType, detail);
        }
      }
      return resolved;
    }
    return targetType;
  }
  
  public Sym resolveSym(Sym containingSymbol, Sym targetSym, ResolveListener listener, String detail)
  {
    if (targetSym == null) {
      return null;
    }
    BasicSym basicTargetSym = (BasicSym)targetSym;
    if (Assert.ASSERTS_ENABLED) {
      Assert.that(state == 1, "wrong state");
    }
    if (basicTargetSym.isLazy())
    {
      BasicSym resolved = (BasicSym)lazySymMap.get(((LazyBlockSym)targetSym).getKey());
      if (resolved == null)
      {
        listener.resolveFailed(containingSymbol, (LazyBlockSym)targetSym, detail);
        return targetSym;
      }
      if (resolved.isLazy()) {
        listener.resolveFailed(containingSymbol, (LazyBlockSym)targetSym, detail);
      }
      return resolved;
    }
    return targetSym;
  }
  
  private void resolveLazyMap(ResolveListener listener)
  {
    for (Iterator iter = lazyTypeMap.entrySet().iterator(); iter.hasNext();)
    {
      Map.Entry entry = (Map.Entry)iter.next();
      BasicType t = (BasicType)entry.getValue();
      BasicType t2 = (BasicType)t.resolveTypes(this, listener);
      if (t2 != t) {
        entry.setValue(t2);
      }
    }
  }
  
  private BlockSym searchBlocks(Address addr, int lowIdx, int highIdx)
  {
    if (highIdx < lowIdx) {
      return null;
    }
    if ((lowIdx == highIdx) || (lowIdx == highIdx - 1))
    {
      Address lastAddr = null;
      BlockSym ret = null;
      for (int i = highIdx; i >= 0; i--)
      {
        BlockSym block = (BlockSym)blocks.get(i);
        if (AddressOps.lte(block.getAddress(), addr))
        {
          if ((lastAddr != null) && (!AddressOps.equal(block.getAddress(), lastAddr))) {
            break;
          }
          lastAddr = block.getAddress();
          ret = block;
        }
      }
      return ret;
    }
    int midIdx = lowIdx + highIdx >> 1;
    BlockSym block = (BlockSym)blocks.get(midIdx);
    if (AddressOps.lte(block.getAddress(), addr)) {
      return searchBlocks(addr, midIdx, highIdx);
    }
    return searchBlocks(addr, lowIdx, midIdx);
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.debugger.cdbg.basic.BasicCDebugInfoDataBase
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.debugger.cdbg.basic;

import sun.jvm.hotspot.debugger.cdbg.LocalSym;
import sun.jvm.hotspot.debugger.cdbg.NamedFieldIdentifier;
import sun.jvm.hotspot.debugger.cdbg.Type;

final class BasicCFrame$1
  implements NamedFieldIdentifier
{
  private final BasicCFrame this$0;
  
  BasicCFrame$1(BasicCFrame paramBasicCFrame, LocalSym paramLocalSym) {}
  
  public Type getType()
  {
    return val$local.getType();
  }
  
  public String getName()
  {
    return val$local.getName();
  }
  
  public String toString()
  {
    return getName();
  }
}

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

import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.cdbg.BlockSym;
import sun.jvm.hotspot.debugger.cdbg.CDebugger;
import sun.jvm.hotspot.debugger.cdbg.CFrame;
import sun.jvm.hotspot.debugger.cdbg.ClosestSymbol;
import sun.jvm.hotspot.debugger.cdbg.LoadObject;
import sun.jvm.hotspot.debugger.cdbg.LocalSym;
import sun.jvm.hotspot.debugger.cdbg.NamedFieldIdentifier;
import sun.jvm.hotspot.debugger.cdbg.ObjectVisitor;
import sun.jvm.hotspot.debugger.cdbg.Type;

public abstract class BasicCFrame
  implements CFrame
{
  private CDebugger dbg;
  
  protected BasicCFrame(CDebugger dbg)
  {
    this.dbg = dbg;
  }
  
  protected CDebugger dbg()
  {
    return dbg;
  }
  
  public LoadObject loadObjectForPC()
  {
    return dbg.loadObjectContainingPC(pc());
  }
  
  public BlockSym blockForPC()
  {
    LoadObject lo = loadObjectForPC();
    if (lo == null) {
      return null;
    }
    return lo.debugInfoForPC(pc());
  }
  
  public ClosestSymbol closestSymbolToPC()
  {
    LoadObject lo = loadObjectForPC();
    if (lo == null) {
      return null;
    }
    return lo.closestSymbolToPC(pc());
  }
  
  public void iterateLocals(ObjectVisitor v)
  {
    BlockSym block = blockForPC();
    while (block != null)
    {
      for (int i = 0; i < block.getNumLocals(); i++)
      {
        final LocalSym local = block.getLocal(i);
        Type t = local.getType();
        if (t != null) {
          t.iterateObject(localVariableBase().addOffsetTo(local.getFrameOffset()), v, new NamedFieldIdentifier()
          {
            public Type getType()
            {
              return local.getType();
            }
            
            public String getName()
            {
              return local.getName();
            }
            
            public String toString()
            {
              return getName();
            }
          });
        }
      }
      block = block.getParent();
    }
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.debugger.cdbg.basic.BasicCFrame
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.debugger.cdbg.basic;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.cdbg.BaseClass;
import sun.jvm.hotspot.debugger.cdbg.CompoundType;
import sun.jvm.hotspot.debugger.cdbg.Field;
import sun.jvm.hotspot.debugger.cdbg.FieldIdentifier;
import sun.jvm.hotspot.debugger.cdbg.ObjectVisitor;
import sun.jvm.hotspot.debugger.cdbg.Type;
import sun.jvm.hotspot.debugger.cdbg.TypeVisitor;
import sun.jvm.hotspot.utilities.Assert;

public class BasicCompoundType
  extends BasicType
  implements CompoundType
{
  private CompoundTypeKind kind;
  private List baseClasses;
  private List fields;
  
  public BasicCompoundType(String name, int size, CompoundTypeKind kind)
  {
    this(name, size, kind, 0);
  }
  
  private BasicCompoundType(String name, int size, CompoundTypeKind kind, int cvAttributes)
  {
    super(name, size, cvAttributes);
    if (Assert.ASSERTS_ENABLED) {
      Assert.that(kind != null, "null kind");
    }
    this.kind = kind;
  }
  
  public CompoundType asCompound()
  {
    return this;
  }
  
  public int getNumBaseClasses()
  {
    return baseClasses == null ? 0 : baseClasses.size();
  }
  
  public BaseClass getBaseClass(int i)
  {
    return (BaseClass)baseClasses.get(i);
  }
  
  public void addBaseClass(BaseClass b)
  {
    if (baseClasses == null) {
      baseClasses = new ArrayList();
    }
    baseClasses.add(b);
  }
  
  public int getNumFields()
  {
    return fields == null ? 0 : fields.size();
  }
  
  public Field getField(int i)
  {
    return (Field)fields.get(i);
  }
  
  public void addField(Field f)
  {
    if (fields == null) {
      fields = new ArrayList();
    }
    fields.add(f);
  }
  
  public boolean isClass()
  {
    return kind == CompoundTypeKind.CLASS;
  }
  
  public boolean isStruct()
  {
    return kind == CompoundTypeKind.STRUCT;
  }
  
  public boolean isUnion()
  {
    return kind == CompoundTypeKind.UNION;
  }
  
  Type resolveTypes(BasicCDebugInfoDataBase db, ResolveListener listener)
  {
    super.resolveTypes(db, listener);
    Iterator iter;
    if (baseClasses != null) {
      for (iter = baseClasses.iterator(); iter.hasNext();)
      {
        BasicBaseClass b = (BasicBaseClass)iter.next();
        b.resolveTypes(this, db, listener);
      }
    }
    Iterator iter;
    if (fields != null) {
      for (iter = fields.iterator(); iter.hasNext();)
      {
        BasicField b = (BasicField)iter.next();
        b.resolveTypes(this, db, listener);
      }
    }
    return this;
  }
  
  public void iterateObject(Address a, ObjectVisitor v, FieldIdentifier f)
  {
    if (f == null)
    {
      for (int i = 0; i < getNumBaseClasses(); i++)
      {
        BasicCompoundType b = (BasicCompoundType)getBaseClass(i).getType();
        b.iterateObject(a, v, f);
      }
      v.enterType(this, a);
      for (int i = 0; i < getNumFields(); i++)
      {
        Field field = getField(i);
        BasicType fieldType = (BasicType)field.getType();
        fieldType.iterateObject(a.addOffsetTo(field.getOffset()), v, new BasicNamedFieldIdentifier(field));
      }
      v.exitType();
    }
    else
    {
      v.doCompound(f, a);
    }
  }
  
  protected Type createCVVariant(int cvAttributes)
  {
    BasicCompoundType t = new BasicCompoundType(getName(), getSize(), kind, cvAttributes);
    kind = kind;
    baseClasses = baseClasses;
    fields = fields;
    return t;
  }
  
  public void visit(TypeVisitor v)
  {
    v.doCompoundType(this);
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.debugger.cdbg.basic.BasicCompoundType
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.debugger.cdbg.basic;

import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.ThreadProxy;
import sun.jvm.hotspot.debugger.cdbg.DebugEvent;
import sun.jvm.hotspot.debugger.cdbg.DebugEvent.Type;

public class BasicDebugEvent
  implements DebugEvent
{
  private DebugEvent.Type type;
  private ThreadProxy thread;
  private Address pc;
  private Address address;
  private boolean wasWrite;
  private String detail;
  
  public BasicDebugEvent(DebugEvent.Type type, ThreadProxy thread)
  {
    this.type = type;
    this.thread = thread;
  }
  
  public DebugEvent.Type getType()
  {
    return type;
  }
  
  public ThreadProxy getThread()
  {
    return thread;
  }
  
  public Address getPC()
  {
    return pc;
  }
  
  public boolean getWasWrite()
  {
    return wasWrite;
  }
  
  public Address getAddress()
  {
    return address;
  }
  
  public String getUnknownEventDetail()
  {
    return detail;
  }
  
  public void setType(DebugEvent.Type type)
  {
    this.type = type;
  }
  
  public void setThread(ThreadProxy thread)
  {
    this.thread = thread;
  }
  
  public void setPC(Address pc)
  {
    this.pc = pc;
  }
  
  public void setWasWrite(boolean val)
  {
    wasWrite = val;
  }
  
  public void setAddress(Address address)
  {
    this.address = address;
  }
  
  public void setUnknownEventDetail(String msg)
  {
    detail = msg;
  }
  
  public static BasicDebugEvent newLoadObjectLoadEvent(ThreadProxy thread, Address base)
  {
    return newAddressEvent(DebugEvent.Type.LOADOBJECT_LOAD, thread, base);
  }
  
  public static BasicDebugEvent newLoadObjectUnloadEvent(ThreadProxy thread, Address base)
  {
    return newAddressEvent(DebugEvent.Type.LOADOBJECT_UNLOAD, thread, base);
  }
  
  public static BasicDebugEvent newBreakpointEvent(ThreadProxy thread, Address pc)
  {
    return newPCEvent(DebugEvent.Type.BREAKPOINT, thread, pc);
  }
  
  public static BasicDebugEvent newSingleStepEvent(ThreadProxy thread, Address pc)
  {
    return newPCEvent(DebugEvent.Type.BREAKPOINT, thread, pc);
  }
  
  public static BasicDebugEvent newAccessViolationEvent(ThreadProxy thread, Address pc, boolean wasWrite, Address addr)
  {
    BasicDebugEvent ev = newPCEvent(DebugEvent.Type.ACCESS_VIOLATION, thread, pc);
    ev.setWasWrite(wasWrite);
    ev.setAddress(addr);
    return ev;
  }
  
  public static BasicDebugEvent newUnknownEvent(ThreadProxy thread, String detail)
  {
    BasicDebugEvent ev = new BasicDebugEvent(DebugEvent.Type.UNKNOWN, thread);
    ev.setUnknownEventDetail(detail);
    return ev;
  }
  
  private static BasicDebugEvent newAddressEvent(DebugEvent.Type type, ThreadProxy thread, Address addr)
  {
    BasicDebugEvent ev = new BasicDebugEvent(type, thread);
    ev.setAddress(addr);
    return ev;
  }
  
  private static BasicDebugEvent newPCEvent(DebugEvent.Type type, ThreadProxy thread, Address pc)
  {
    BasicDebugEvent ev = new BasicDebugEvent(type, thread);
    ev.setPC(pc);
    return ev;
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.debugger.cdbg.basic.BasicDebugEvent
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.debugger.cdbg.basic;

import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.cdbg.DoubleType;
import sun.jvm.hotspot.debugger.cdbg.FieldIdentifier;
import sun.jvm.hotspot.debugger.cdbg.ObjectVisitor;
import sun.jvm.hotspot.debugger.cdbg.Type;
import sun.jvm.hotspot.debugger.cdbg.TypeVisitor;

public class BasicDoubleType
  extends BasicType
  implements DoubleType
{
  public BasicDoubleType(String name, int size)
  {
    this(name, size, 0);
  }
  
  private BasicDoubleType(String name, int size, int cvAttributes)
  {
    super(name, size, cvAttributes);
  }
  
  public DoubleType asDouble()
  {
    return this;
  }
  
  public void iterateObject(Address a, ObjectVisitor v, FieldIdentifier f)
  {
    v.doDouble(f, a.getJDoubleAt(0L));
  }
  
  protected Type createCVVariant(int cvAttributes)
  {
    return new BasicDoubleType(getName(), getSize(), cvAttributes);
  }
  
  public void visit(TypeVisitor v)
  {
    v.doDoubleType(this);
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.debugger.cdbg.basic.BasicDoubleType
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.debugger.cdbg.basic;

class BasicEnumType$Enum
{
  String name;
  long value;
  
  BasicEnumType$Enum(String name, long value)
  {
    this.name = name;
    this.value = value;
  }
  
  String getName()
  {
    return name;
  }
  
  long getValue()
  {
    return value;
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.debugger.cdbg.basic.BasicEnumType.Enum
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.debugger.cdbg.basic;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.cdbg.EnumType;
import sun.jvm.hotspot.debugger.cdbg.FieldIdentifier;
import sun.jvm.hotspot.debugger.cdbg.IntType;
import sun.jvm.hotspot.debugger.cdbg.ObjectVisitor;
import sun.jvm.hotspot.debugger.cdbg.Type;
import sun.jvm.hotspot.debugger.cdbg.TypeVisitor;
import sun.jvm.hotspot.utilities.Assert;

public class BasicEnumType
  extends BasicIntType
  implements EnumType
{
  private Type underlyingType;
  private List enums;
  
  private static class Enum
  {
    String name;
    long value;
    
    Enum(String name, long value)
    {
      this.name = name;
      this.value = value;
    }
    
    String getName()
    {
      return name;
    }
    
    long getValue()
    {
      return value;
    }
  }
  
  public BasicEnumType(String name, Type underlyingType)
  {
    this(name, underlyingType, 0);
  }
  
  private BasicEnumType(String name, Type underlyingType, int cvAttributes)
  {
    super(name, 0, false, cvAttributes);
    this.underlyingType = underlyingType;
  }
  
  public EnumType asEnum()
  {
    return this;
  }
  
  public int getSize()
  {
    return underlyingType.getSize();
  }
  
  public boolean isUnsigned()
  {
    if (underlyingType.isInt()) {
      return ((IntType)underlyingType).isUnsigned();
    }
    return false;
  }
  
  public void addEnum(String name, long val)
  {
    if (enums == null) {
      enums = new ArrayList();
    }
    enums.add(new Enum(name, val));
  }
  
  public int getNumEnumerates()
  {
    return enums.size();
  }
  
  public String getEnumName(int i)
  {
    return ((Enum)enums.get(i)).getName();
  }
  
  public long getEnumValue(int i)
  {
    return ((Enum)enums.get(i)).getValue();
  }
  
  public String enumNameForValue(long val)
  {
    if (enums == null) {
      return null;
    }
    for (Iterator iter = enums.iterator(); iter.hasNext();)
    {
      Enum e = (Enum)iter.next();
      if (e.getValue() == val) {
        return e.getName();
      }
    }
    return null;
  }
  
  Type resolveTypes(BasicCDebugInfoDataBase db, ResolveListener listener)
  {
    super.resolveTypes(db, listener);
    underlyingType = db.resolveType(this, underlyingType, listener, "resolving enum type");
    if (Assert.ASSERTS_ENABLED)
    {
      BasicType b = (BasicType)underlyingType;
      Assert.that((b.isLazy()) || (b.isInt()), "Underlying type of enum must be integer type (or unresolved due to error)");
    }
    return this;
  }
  
  public void iterat
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