sa-jdi

 return field.getCInteger(type);
  }
  
  public Address getAddress()
    throws UnmappedAddressException, UnalignedAddressException
  {
    return field.getAddress();
  }
  
  public OopHandle getOopHandle()
    throws UnmappedAddressException, UnalignedAddressException, NotInHeapException
  {
    return field.getOopHandle();
  }
  
  public OopHandle getNarrowOopHandle()
    throws UnmappedAddressException, UnalignedAddressException, NotInHeapException
  {
    return field.getNarrowOopHandle();
  }
}

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

import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.UnalignedAddressException;
import sun.jvm.hotspot.debugger.UnmappedAddressException;
import sun.jvm.hotspot.types.JBooleanField;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.WrongTypeException;

public class BasicJBooleanField
  extends BasicField
  implements JBooleanField
{
  public BasicJBooleanField(BasicTypeDataBase db, Type containingType, String name, Type type, boolean isStatic, long offset, Address staticFieldAddress)
  {
    super(db, containingType, name, type, isStatic, offset, staticFieldAddress);
    if (!type.equals(db.getJBooleanType())) {
      throw new WrongTypeException("Type of a BasicJBooleanField must be db.getJBooleanType()");
    }
  }
  
  public boolean getValue(Address addr)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    return getJBoolean(addr);
  }
  
  public boolean getValue()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    return getJBoolean();
  }
}

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

import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.UnalignedAddressException;
import sun.jvm.hotspot.debugger.UnmappedAddressException;
import sun.jvm.hotspot.types.JByteField;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.WrongTypeException;

public class BasicJByteField
  extends BasicField
  implements JByteField
{
  public BasicJByteField(BasicTypeDataBase db, Type containingType, String name, Type type, boolean isStatic, long offset, Address staticFieldAddress)
  {
    super(db, containingType, name, type, isStatic, offset, staticFieldAddress);
    if (!type.equals(db.getJByteType())) {
      throw new WrongTypeException("Type of a BasicJByteField must be db.getJByteType()");
    }
  }
  
  public byte getValue(Address addr)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    return getJByte(addr);
  }
  
  public byte getValue()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    return getJByte();
  }
}

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

import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.UnalignedAddressException;
import sun.jvm.hotspot.debugger.UnmappedAddressException;
import sun.jvm.hotspot.types.JCharField;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.WrongTypeException;

public class BasicJCharField
  extends BasicField
  implements JCharField
{
  public BasicJCharField(BasicTypeDataBase db, Type containingType, String name, Type type, boolean isStatic, long offset, Address staticFieldAddress)
  {
    super(db, containingType, name, type, isStatic, offset, staticFieldAddress);
    if (!type.equals(db.getJCharType())) {
      throw new WrongTypeException("Type of a BasicJCharField must be db.getJCharType()");
    }
  }
  
  public char getValue(Address addr)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    return getJChar(addr);
  }
  
  public char getValue()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    return getJChar();
  }
}

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

import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.UnalignedAddressException;
import sun.jvm.hotspot.debugger.UnmappedAddressException;
import sun.jvm.hotspot.types.JDoubleField;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.WrongTypeException;

public class BasicJDoubleField
  extends BasicField
  implements JDoubleField
{
  public BasicJDoubleField(BasicTypeDataBase db, Type containingType, String name, Type type, boolean isStatic, long offset, Address staticFieldAddress)
  {
    super(db, containingType, name, type, isStatic, offset, staticFieldAddress);
    if (!type.equals(db.getJDoubleType())) {
      throw new WrongTypeException("Type of a BasicJDoubleField must be equal to TypeDataBase.getJDoubleType()");
    }
  }
  
  public double getValue(Address addr)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    return getJDouble(addr);
  }
  
  public double getValue()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    return getJDouble();
  }
}

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

import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.UnalignedAddressException;
import sun.jvm.hotspot.debugger.UnmappedAddressException;
import sun.jvm.hotspot.types.JFloatField;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.WrongTypeException;

public class BasicJFloatField
  extends BasicField
  implements JFloatField
{
  public BasicJFloatField(BasicTypeDataBase db, Type containingType, String name, Type type, boolean isStatic, long offset, Address staticFieldAddress)
  {
    super(db, containingType, name, type, isStatic, offset, staticFieldAddress);
    if (!type.equals(db.getJFloatType())) {
      throw new WrongTypeException("Type of a BasicJFloatField must be equal to TypeDataBase.getJFloatType()");
    }
  }
  
  public float getValue(Address addr)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    return getJFloat(addr);
  }
  
  public float getValue()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    return getJFloat();
  }
}

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

import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.UnalignedAddressException;
import sun.jvm.hotspot.debugger.UnmappedAddressException;
import sun.jvm.hotspot.types.JIntField;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.WrongTypeException;

public class BasicJIntField
  extends BasicField
  implements JIntField
{
  public BasicJIntField(BasicTypeDataBase db, Type containingType, String name, Type type, boolean isStatic, long offset, Address staticFieldAddress)
  {
    super(db, containingType, name, type, isStatic, offset, staticFieldAddress);
    if (!type.equals(db.getJIntType())) {
      throw new WrongTypeException("Type of a BasicJIntField must be equal to TypeDataBase.getJIntType()");
    }
  }
  
  public int getValue(Address addr)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    return getJInt(addr);
  }
  
  public int getValue()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    return getJInt();
  }
}

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

import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.UnalignedAddressException;
import sun.jvm.hotspot.debugger.UnmappedAddressException;
import sun.jvm.hotspot.types.JLongField;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.WrongTypeException;

public class BasicJLongField
  extends BasicField
  implements JLongField
{
  public BasicJLongField(BasicTypeDataBase db, Type containingType, String name, Type type, boolean isStatic, long offset, Address staticFieldAddress)
  {
    super(db, containingType, name, type, isStatic, offset, staticFieldAddress);
    if (!type.equals(db.getJLongType())) {
      throw new WrongTypeException("Type of a BasicJLongField must be equal to TypeDataBase.getJLongType()");
    }
  }
  
  public long getValue(Address addr)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    return getJLong(addr);
  }
  
  public long getValue()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    return getJLong();
  }
}

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

import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.UnalignedAddressException;
import sun.jvm.hotspot.debugger.UnmappedAddressException;
import sun.jvm.hotspot.types.JShortField;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.WrongTypeException;

public class BasicJShortField
  extends BasicField
  implements JShortField
{
  public BasicJShortField(BasicTypeDataBase db, Type containingType, String name, Type type, boolean isStatic, long offset, Address staticFieldAddress)
  {
    super(db, containingType, name, type, isStatic, offset, staticFieldAddress);
    if (!type.equals(db.getJShortType())) {
      throw new WrongTypeException("Type of a BasicJShortField must be equal to TypeDataBase.getJShortType()");
    }
  }
  
  public short getValue(Address addr)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    return getJShort(addr);
  }
  
  public short getValue()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    return getJShort();
  }
}

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

import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.OopHandle;
import sun.jvm.hotspot.debugger.UnalignedAddressException;
import sun.jvm.hotspot.debugger.UnmappedAddressException;
import sun.jvm.hotspot.types.NarrowOopField;
import sun.jvm.hotspot.types.OopField;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.WrongTypeException;

public class BasicNarrowOopField
  extends BasicOopField
  implements NarrowOopField
{
  private static final boolean DEBUG = false;
  
  public BasicNarrowOopField(OopField oopf)
  {
    super(oopf);
  }
  
  public BasicNarrowOopField(BasicTypeDataBase db, Type containingType, String name, Type type, boolean isStatic, long offset, Address staticFieldAddress)
  {
    super(db, containingType, name, type, isStatic, offset, staticFieldAddress);
    if (!type.isOopType()) {
      throw new WrongTypeException("Type of a BasicOopField must be an oop type");
    }
  }
  
  public OopHandle getValue(Address addr)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    return getNarrowOopHandle(addr);
  }
  
  public OopHandle getValue()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    return getNarrowOopHandle();
  }
}

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

import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.OopHandle;
import sun.jvm.hotspot.debugger.UnalignedAddressException;
import sun.jvm.hotspot.debugger.UnmappedAddressException;
import sun.jvm.hotspot.types.OopField;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.WrongTypeException;

public class BasicOopField
  extends BasicField
  implements OopField
{
  public BasicOopField(OopField oopf)
  {
    super(oopf);
  }
  
  public BasicOopField(BasicTypeDataBase db, Type containingType, String name, Type type, boolean isStatic, long offset, Address staticFieldAddress)
  {
    super(db, containingType, name, type, isStatic, offset, staticFieldAddress);
    if (!type.isOopType()) {
      throw new WrongTypeException("Type of a BasicOopField must be an oop type");
    }
  }
  
  public OopHandle getValue(Address addr)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    return getOopHandle(addr);
  }
  
  public OopHandle getValue()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    return getOopHandle();
  }
}

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

import sun.jvm.hotspot.types.PointerType;
import sun.jvm.hotspot.types.Type;

public class BasicPointerType
  extends BasicType
  implements PointerType
{
  private Type targetType;
  
  public BasicPointerType(BasicTypeDataBase db, String name, Type targetType)
  {
    super(db, name, null);
    
    this.targetType = targetType;
  }
  
  public boolean isPointerType()
  {
    return true;
  }
  
  public Type getTargetType()
  {
    return targetType;
  }
}

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

import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import sun.jvm.hotspot.types.AddressField;
import sun.jvm.hotspot.types.CIntegerField;
import sun.jvm.hotspot.types.CIntegerType;
import sun.jvm.hotspot.types.Field;
import sun.jvm.hotspot.types.JBooleanField;
import sun.jvm.hotspot.types.JByteField;
import sun.jvm.hotspot.types.JCharField;
import sun.jvm.hotspot.types.JDoubleField;
import sun.jvm.hotspot.types.JFloatField;
import sun.jvm.hotspot.types.JIntField;
import sun.jvm.hotspot.types.JLongField;
import sun.jvm.hotspot.types.JShortField;
import sun.jvm.hotspot.types.NarrowOopField;
import sun.jvm.hotspot.types.OopField;
import sun.jvm.hotspot.types.PointerType;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.WrongTypeException;
import sun.jvm.hotspot.utilities.ConstIterator;

public class BasicType
  implements Type
{
  protected BasicTypeDataBase db;
  private String name;
  private long size;
  private boolean isJavaPrimitiveType;
  private boolean isOopType;
  private Map nameToFieldMap = new HashMap();
  private List fieldList = new LinkedList();
  private Type superclass;
  
  public BasicType(BasicTypeDataBase db, String name, Type superclass)
  {
    if (name == null) {
      throw new IllegalArgumentException("name may not be null");
    }
    this.db = db;
    this.name = name;
    this.superclass = superclass;
  }
  
  public BasicType(BasicTypeDataBase db, String name)
  {
    this(db, name, null);
  }
  
  public boolean equals(Object obj)
  {
    if (obj == null) {
      return false;
    }
    if (!(obj instanceof BasicType)) {
      return false;
    }
    BasicType arg = (BasicType)obj;
    if (!name.equals(name)) {
      return false;
    }
    return true;
  }
  
  public int hashCode()
  {
    return name.hashCode();
  }
  
  public String toString()
  {
    return name;
  }
  
  public String getName()
  {
    return name;
  }
  
  public void setSuperclass(Type superclass)
  {
    this.superclass = superclass;
  }
  
  public Type getSuperclass()
  {
    return superclass;
  }
  
  public void setSize(long sizeInBytes)
  {
    size = sizeInBytes;
  }
  
  public long getSize()
  {
    return size;
  }
  
  public boolean isCIntegerType()
  {
    return false;
  }
  
  public boolean isCStringType()
  {
    if (isPointerType())
    {
      Type target = ((PointerType)this).getTargetType();
      return (target.isCIntegerType()) && (target.getName().equals("const char"));
    }
    return false;
  }
  
  public boolean isJavaPrimitiveType()
  {
    return isJavaPrimitiveType;
  }
  
  public void setIsJavaPrimitiveType(boolean isJavaPrimitiveType)
  {
    this.isJavaPrimitiveType = isJavaPrimitiveType;
  }
  
  public boolean isOopType()
  {
    return isOopType;
  }
  
  public boolean isPointerType()
  {
    return false;
  }
  
  public void setIsOopType(boolean isOopType)
  {
    this.isOopType = isOopType;
  }
  
  public Field getField(String fieldName, boolean searchSuperclassFields, boolean throwExceptionIfNotFound)
  {
    Field field = null;
    if (nameToFieldMap != null)
    {
      field = (Field)nameToFieldMap.get(fieldName);
      if (field != null) {
        return field;
      }
    }
    if ((searchSuperclassFields) && 
      (superclass != null)) {
      field = superclass.getField(fieldName, searchSuperclassFields, false);
    }
    if ((field == null) && (throwExceptionIfNotFound)) {
      throw new RuntimeException("field \"" + fieldName + "\" not found in type " + name);
    }
    return field;
  }
  
  public Field getField(String fieldName, boolean searchSuperclassFields)
  {
    return getField(fieldName, searchSuperclassFields, true);
  }
  
  public Field getField(String fieldName)
  {
    return getField(fieldName, true);
  }
  
  public Field getField(String fieldName, Type declaredType, boolean searchSuperclassFields)
    throws WrongTypeException
  {
    Field res = getField(fieldName, searchSuperclassFields);
    if (res == null) {
      return null;
    }
    if (!res.getType().equals(declaredType)) {
      throw new WrongTypeException("field \"" + fieldName + "\" in type " + name + " is not of type " + declaredType + ", but instead of type " + res.getType());
    }
    return res;
  }
  
  public Field getField(String fieldName, Type declaredType)
    throws WrongTypeException
  {
    return getField(fieldName, declaredType, false);
  }
  
  public Iterator getFields()
  {
    return new ConstIterator(fieldList.iterator());
  }
  
  public JBooleanField getJBooleanField(String fieldName)
    throws WrongTypeException
  {
    return (JBooleanField)getField(fieldName, db.getJBooleanType());
  }
  
  public JByteField getJByteField(String fieldName)
    throws WrongTypeException
  {
    return (JByteField)getField(fieldName, db.getJByteType());
  }
  
  public JCharField getJCharField(String fieldName)
    throws WrongTypeException
  {
    return (JCharField)getField(fieldName, db.getJCharType());
  }
  
  public JDoubleField getJDoubleField(String fieldName)
    throws WrongTypeException
  {
    return (JDoubleField)getField(fieldName, db.getJDoubleType());
  }
  
  public JFloatField getJFloatField(String fieldName)
    throws WrongTypeException
  {
    return (JFloatField)getField(fieldName, db.getJFloatType());
  }
  
  public JIntField getJIntField(String fieldName)
    throws WrongTypeException
  {
    return (JIntField)getField(fieldName, db.getJIntType());
  }
  
  public JLongField getJLongField(String fieldName)
    throws WrongTypeException
  {
    return (JLongField)getField(fieldName, db.getJLongType());
  }
  
  public JShortField getJShortField(String fieldName)
    throws WrongTypeException
  {
    return (JShortField)getField(fieldName, db.getJShortType());
  }
  
  public CIntegerField getCIntegerField(String fieldName)
    throws WrongTypeException
  {
    Field field = getField(fieldName);
    if (!(field.getType() instanceof CIntegerType)) {
      throw new WrongTypeException("field \"" + fieldName + "\" in type " + name + " is not of C integer type, but instead of type " + field.getType());
    }
    return (CIntegerField)field;
  }
  
  public OopField getOopField(String fieldName)
    throws WrongTypeException
  {
    Field field = getField(fieldName);
    if (!field.getType().isOopType()) {
      throw new WrongTypeException("field \"" + fieldName + "\" in type " + name + " is not of oop type, but instead of type " + field.getType());
    }
    return (OopField)field;
  }
  
  public NarrowOopField getNarrowOopField(String fieldName)
    throws WrongTypeException
  {
    return new BasicNarrowOopField(getOopField(fieldName));
  }
  
  public AddressField getAddressField(String fieldName)
  {
    Field field = getField(fieldName);
    if (field == null) {
      return null;
    }
    return new BasicAddressFieldWrapper(field);
  }
  
  public void addField(Field field)
  {
    if (nameToFieldMap.get(field.getName()) != null) {
      throw new RuntimeException("field of name \"" + field.getName() + "\" already present in type " + this);
    }
    nameToFieldMap.put(field.getName(), field);
    fieldList.add(field);
  }
  
  public void removeField(Field field)
  {
    if (nameToFieldMap.remove(field.getName()) == null) {
      throw new RuntimeException("field of name \"" + field.getName() + "\" was not present");
    }
    fieldList.remove(field);
  }
}

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

import java.io.PrintStream;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.MachineDescription;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.TypeDataBase;

public class BasicTypeDataBase
  implements TypeDataBase
{
  private MachineDescription machDesc;
  private VtblAccess vtblAccess;
  private Map nameToTypeMap = new HashMap();
  private Map nameToIntConstantMap = new HashMap();
  private Map nameToLongConstantMap = new HashMap();
  private Type jbooleanType;
  private Type jbyteType;
  private Type jcharType;
  private Type jdoubleType;
  private Type jfloatType;
  private Type jintType;
  private Type jlongType;
  private Type jshortType;
  private static final boolean DEBUG = System.getProperty("sun.jvm.hotspot.types.basic.BasicTypeDataBase.DEBUG") != null;
  
  public BasicTypeDataBase(MachineDescription machDesc, VtblAccess vtblAccess)
  {
    this.machDesc = machDesc;
    this.vtblAccess = vtblAccess;
  }
  
  public Type lookupType(String cTypeName)
  {
    return lookupType(cTypeName, true);
  }
  
  public Type lookupType(String cTypeName, boolean throwException)
  {
    Type type = (Type)nameToTypeMap.get(cTypeName);
    if ((type == null) && (throwException)) {
      throw new RuntimeException("No type named \"" + cTypeName + "\" in database");
    }
    return type;
  }
  
  public Integer lookupIntConstant(String constantName)
  {
    return lookupIntConstant(constantName, true);
  }
  
  public Integer lookupIntConstant(String constantName, boolean throwException)
  {
    Integer i = (Integer)nameToIntConstantMap.get(constantName);
    if ((i == null) && 
      (throwException)) {
      throw new RuntimeException("No integer constant named \"" + constantName + "\" present in type database");
    }
    return i;
  }
  
  public Long lookupLongConstant(String constantName)
  {
    return lookupLongConstant(constantName, true);
  }
  
  public Long lookupLongConstant(String constantName, boolean throwException)
  {
    Long i = (Long)nameToLongConstantMap.get(constantName);
    if ((i == null) && 
      (throwException)) {
      throw new RuntimeException("No long constant named \"" + constantName + "\" present in type database");
    }
    return i;
  }
  
  public Type getJBooleanType()
  {
    return jbooleanType;
  }
  
  public Type getJByteType()
  {
    return jbyteType;
  }
  
  public Type getJCharType()
  {
    return jcharType;
  }
  
  public Type getJDoubleType()
  {
    return jdoubleType;
  }
  
  public Type getJFloatType()
  {
    return jfloatType;
  }
  
  public Type getJIntType()
  {
    return jintType;
  }
  
  public Type getJLongType()
  {
    return jlongType;
  }
  
  public Type getJShortType()
  {
    return jshortType;
  }
  
  public long getAddressSize()
  {
    return machDesc.getAddressSize();
  }
  
  public long getOopSize()
  {
    return VM.getVM().getOopSize();
  }
  
  public boolean addressTypeIsEqualToType(Address addr, Type type)
  {
    if (addr == null) {
      return false;
    }
    Address vtblAddr = vtblAccess.getVtblForType(type);
    if (vtblAddr == null)
    {
      if (DEBUG) {
        System.err.println("BasicTypeDataBase.addressTypeIsEqualToType: vtblAddr == null");
      }
      return false;
    }
    Type curType = type;
    try
    {
      while (curType != null)
      {
        if (vtblAddr.equals(addr.getAddressAt(0L))) {
          return true;
        }
        long offset = curType.getSize();
        
        offset -= offset % getAddressSize();
        if (offset <= 0L) {
          return false;
        }
        if (vtblAddr.equals(addr.getAddressAt(offset))) {
          return true;
        }
        offset -= getAddressSize();
        if (offset <= 0L) {
          return false;
        }
        if (vtblAddr.equals(addr.getAddressAt(offset))) {
          return true;
        }
        curType = curType.getSuperclass();
      }
    }
    catch (Exception e)
    {
      if (DEBUG)
      {
        System.err.println("BasicTypeDataBase.addressTypeIsEqualToType: exception occurred during lookup:");
        e.printStackTrace();
      }
      return false;
    }
    if (DEBUG) {
      System.err.println("BasicTypeDataBase.addressTypeIsEqualToType: all vptr tests failed for type " + type.getName());
    }
    return false;
  }
  
  public Type guessTypeForAddress(Address addr)
  {
    for (Iterator iter = getTypes(); iter.hasNext();)
    {
      Type t = (Type)iter.next();
      if (addressTypeIsEqualToType(addr, t)) {
        return t;
      }
    }
    return null;
  }
  
  public long cIntegerTypeMaxValue(long sizeInBytes, boolean isUnsigned)
  {
    return machDesc.cIntegerTypeMaxValue(sizeInBytes, isUnsigned);
  }
  
  public long cIntegerTypeMinValue(long sizeInBytes, boolean isUnsigned)
  {
    return machDesc.cIntegerTypeMinValue(sizeInBytes, isUnsigned);
  }
  
  public Iterator getTypes()
  {
    return nameToTypeMap.values().iterator();
  }
  
  public Iterator getIntConstants()
  {
    return nameToIntConstantMap.keySet().iterator();
  }
  
  public Iterator getLongConstants()
  {
    return nameToLongConstantMap.keySet().iterator();
  }
  
  public void setJBooleanType(Type type)
  {
    jbooleanType = type;
  }
  
  public void setJByteType(Type type)
  {
    jbyteType = type;
  }
  
  public void setJCharType(Type type)
  {
    jcharType = type;
  }
  
  public void setJDoubleType(Type type)
  {
    jdoubleType = type;
  }
  
  public void setJFloatType(Type type)
  {
    jfloatType = type;
  }
  
  public void setJIntType(Type type)
  {
    jintType = type;
  }
  
  public void setJLongType(Type type)
  {
    jlongType = type;
  }
  
  public void setJShortType(Type type)
  {
    jshortType = type;
  }
  
  public void addType(Type type)
  {
    if (nameToTypeMap.get(type.getName()) != null) {
      throw new RuntimeException("type of name \"" + type.getName() + "\" already present");
    }
    nameToTypeMap.put(type.getName(), type);
  }
  
  public void removeType(Type type)
  {
    Type curType = (Type)nameToTypeMap.get(type.getName());
    if (curType == null) {
      throw new RuntimeException("type of name \"" + type.getName() + "\" not present");
    }
    if (!curType.equals(type)) {
      throw new RuntimeException("a different type of name \"" + type.getName() + "\" was present");
    }
    nameToTypeMap.remove(type.getName());
  }
  
  public void addIntConstant(String name, int value)
  {
    if (nameToIntConstantMap.get(name) != null) {
      throw new RuntimeException("int constant of name \"" + name + "\" already present");
    }
    nameToIntConstantMap.put(name, new Integer(value));
  }
  
  public void removeIntConstant(String name)
  {
    Integer curConstant = (Integer)nameToIntConstantMap.get(name);
    if (curConstant == null) {
      throw new RuntimeException("int constant of name \"" + name + "\" not present");
    }
    nameToIntConstantMap.remove(name);
  }
  
  public void addLongConstant(String name, long value)
  {
    if (nameToLongConstantMap.get(name) != null) {
      throw new RuntimeException("long constant of name \"" + name + "\" already present");
    }
    nameToLongConstantMap.put(name, new Long(value));
  }
  
  public void removeLongConstant(String name)
  {
    Long curConstant = (Long)nameToLongConstantMap.get(name);
    if (curConstant == null) {
      throw new RuntimeException("long constant of name \"" + name + "\" not present");
    }
    nameToLongConstantMap.remove(name);
  }
}

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

import java.util.HashMap;
import java.util.Map;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.SymbolLookup;
import sun.jvm.hotspot.types.Type;

public abstract class BasicVtblAccess
  implements VtblAccess
{
  protected SymbolLookup symbolLookup;
  protected String[] dllNames;
  private Map typeToVtblMap = new HashMap();
  
  public BasicVtblAccess(SymbolLookup symbolLookup, String[] dllNames)
  {
    this.symbolLookup = symbolLookup;
    this.dllNames = dllNames;
  }
  
  static Object nullAddress = new Object();
  
  public Address getVtblForType(Type type)
  {
    if (type == null) {
      return null;
    }
    Object result = typeToVtblMap.get(type);
    if (result == nullAddress) {
      return null;
    }
    if (result != null) {
      return (Address)result;
    }
    String vtblSymbol = vtblSymbolForType(type);
    if (vtblSymbol == null)
    {
      typeToVtblMap.put(type, nullAddress);
      return null;
    }
    for (int i = 0; i < dllNames.length; i++)
    {
      Address addr = symbolLookup.lookup(dllNames[i], vtblSymbol);
      if (addr != null)
      {
        typeToVtblMap.put(type, addr);
        return addr;
      }
    }
    typeToVtblMap.put(type, nullAddress);
    return null;
  }
  
  public void clearCaches()
  {
    typeToVtblMap.clear();
  }
  
  protected abstract String vtblSymbolForType(Type paramType);
}

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

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

public abstract interface VtblAccess
{
  public abstract Address getVtblForType(Type paramType);
  
  public abstract void clearCaches();
}

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

import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.UnalignedAddressException;
import sun.jvm.hotspot.debugger.UnmappedAddressException;

public abstract interface CIntegerField
  extends Field
{
  public abstract boolean isUnsigned();
  
  public abstract long getValue(Address paramAddress)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException;
  
  public abstract long getValue()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException;
}

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

public abstract interface CIntegerType
  extends Type
{
  public abstract boolean isUnsigned();
  
  public abstract long maxValue();
  
  public abstract long minValue();
}

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

import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.NotInHeapException;
import sun.jvm.hotspot.debugger.OopHandle;
import sun.jvm.hotspot.debugger.UnalignedAddressException;
import sun.jvm.hotspot.debugger.UnmappedAddressException;

public abstract interface Field
{
  public abstract String getName();
  
  public abstract Type getType();
  
  public abstract long getSize();
  
  public abstract boolean isStatic();
  
  public abstract long getOffset()
    throws WrongTypeException;
  
  public abstract Address getStaticFieldAddress()
    throws WrongTypeException;
  
  public abstract boolean getJBoolean(Address paramAddress)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException;
  
  public abstract byte getJByte(Address paramAddress)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException;
  
  public abstract char getJChar(Address paramAddress)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException;
  
  public abstract short getJShort(Address paramAddress)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException;
  
  public abstract int getJInt(Address paramAddress)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException;
  
  public abstract long getJLong(Address paramAddress)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException;
  
  public abstract float getJFloat(Address paramAddress)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException;
  
  public abstract double getJDouble(Address paramAddress)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException;
  
  public abstract long getCInteger(Address paramAddress, CIntegerType paramCIntegerType)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException;
  
  public abstract Address getAddress(Address paramAddress)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException;
  
  public abstract OopHandle getOopHandle(Address paramAddress)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException, NotInHeapException;
  
  public abstract OopHandle getNarrowOopHandle(Address paramAddress)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException, NotInHeapException;
  
  public abstract boolean getJBoolean()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException;
  
  public abstract byte getJByte()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException;
  
  public abstract char getJChar()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException;
  
  public abstract float getJFloat()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException;
  
  public abstract double getJDouble()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException;
  
  public abstract int getJInt()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException;
  
  public abstract long getJLong()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException;
  
  public abstract short getJShort()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException;
  
  public abstract long getCInteger(CIntegerType paramCIntegerType)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException;
  
  public abstract Address getAddress()
    throws UnmappedAddressException, UnalignedAddressException;
  
  public abstract OopHandle getOopHandle()
    throws UnmappedAddressException, UnalignedAddressException, NotInHeapException;
  
  public abstract OopHandle getNarrowOopHandle()
    throws UnmappedAddressException, UnalignedAddressException, NotInHeapException;
}

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

import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.UnalignedAddressException;
import sun.jvm.hotspot.debugger.UnmappedAddressException;

public abstract interface JBooleanField
  extends Field
{
  public abstract boolean getValue(Address paramAddress)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException;
  
  public abstract boolean getValue()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException;
}

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

import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.UnalignedAddressException;
import sun.jvm.hotspot.debugger.UnmappedAddressException;

public abstract interface JByteField
  extends Field
{
  public abstract byte getValue(Address paramAddress)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException;
  
  public abstract byte getValue()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException;
}

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

import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.UnalignedAddressException;
import sun.jvm.hotspot.debugger.UnmappedAddressException;

public abstract interface JCharField
  extends Field
{
  public abstract char getValue(Address paramAddress)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException;
  
  public abstract char getValue()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException;
}

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

import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.UnalignedAddressException;
import sun.jvm.hotspot.debugger.UnmappedAddressException;

public abstract interface JDoubleField
  extends Field
{
  public abstract double getValue(Address paramAddress)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException;
  
  public abstract double getValue()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException;
}

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

import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.UnalignedAddressException;
import sun.jvm.hotspot.debugger.UnmappedAddressException;

public abstract interface JFloatField
  extends Field
{
  public abstract float getValue(Address paramAddress)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException;
  
  public abstract float getValue()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException;
}

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

import sun.jvm.hotspot.debugger.Address;
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