sa-jdi

  }
      if (isServer)
      {
        RemoteDebuggerServer remote = null;
        try
        {
          remote = new RemoteDebuggerServer(debugger);
        }
        catch (RemoteException rem)
        {
          throw new DebuggerException(rem);
        }
        RMIHelper.rebind(serverID, remote);
      }
    }
    else
    {
      connectRemoteDebugger();
    }
  }
  
  private void setupVM()
  {
    try
    {
      if (os.equals("solaris")) {
        db = new HotSpotTypeDataBase(machDesc, new HotSpotSolarisVtblAccess(debugger, jvmLibNames), debugger, jvmLibNames);
      } else if (os.equals("win32")) {
        db = new HotSpotTypeDataBase(machDesc, new Win32VtblAccess(debugger, jvmLibNames), debugger, jvmLibNames);
      } else if (os.equals("linux")) {
        db = new HotSpotTypeDataBase(machDesc, new LinuxVtblAccess(debugger, jvmLibNames), debugger, jvmLibNames);
      } else {
        throw new DebuggerException("OS \"" + os + "\" not yet supported (no VtblAccess yet)");
      }
    }
    catch (NoSuchSymbolException e)
    {
      throw new DebuggerException("Doesn't appear to be a HotSpot VM (could not find symbol \"" + e.getSymbol() + "\" in remote process)");
    }
    if (startupMode != 2) {
      debugger.configureJavaPrimitiveTypeSizes(db.getJBooleanType().getSize(), db.getJByteType().getSize(), db.getJCharType().getSize(), db.getJDoubleType().getSize(), db.getJFloatType().getSize(), db.getJIntType().getSize(), db.getJLongType().getSize(), db.getJShortType().getSize());
    }
    if (!isServer) {
      try
      {
        VM.initialize(db, debugger);
      }
      catch (DebuggerException e)
      {
        throw e;
      }
      catch (Exception e)
      {
        throw new DebuggerException(e);
      }
    }
  }
  
  private void setupDebuggerSolaris()
  {
    setupJVMLibNamesSolaris();
    if (System.getProperty("sun.jvm.hotspot.debugger.useProcDebugger") != null)
    {
      ProcDebuggerLocal dbg = new ProcDebuggerLocal(null, true);
      debugger = dbg;
      attachDebugger();
      if (cpu.equals("x86"))
      {
        machDesc = new MachineDescriptionIntelX86();
      }
      else if (cpu.equals("sparc"))
      {
        int addressSize = dbg.getRemoteProcessAddressSize();
        if (addressSize == -1) {
          throw new DebuggerException("Error occurred while trying to determine the remote process's address size");
        }
        if (addressSize == 32) {
          machDesc = new MachineDescriptionSPARC32Bit();
        } else if (addressSize == 64) {
          machDesc = new MachineDescriptionSPARC64Bit();
        } else {
          throw new DebuggerException("Address size " + addressSize + " is not supported on SPARC");
        }
      }
      else if (cpu.equals("amd64"))
      {
        machDesc = new MachineDescriptionAMD64();
      }
      else
      {
        throw new DebuggerException("Solaris only supported on sparc/sparcv9/x86/amd64");
      }
      dbg.setMachineDescription(machDesc);
      return;
    }
    String[] dbxSvcAgentDSOPathNames = null;
    
    String dbxPathName = System.getProperty("dbxPathName");
    if (dbxPathName == null)
    {
      String dbxPathPrefix = System.getProperty("dbxPathPrefix");
      if (dbxPathPrefix == null) {
        dbxPathPrefix = "/net/jano.sfbay/export/disk05/hotspot/sa";
      }
      dbxPathName = dbxPathPrefix + fileSep + os + fileSep + cpu + fileSep + "bin" + fileSep + "dbx";
    }
    String dbxSvcAgentDSOPathName = System.getProperty("dbxSvcAgentDSOPathName");
    if (dbxSvcAgentDSOPathName != null)
    {
      dbxSvcAgentDSOPathNames = new String[] { dbxSvcAgentDSOPathName };
    }
    else
    {
      String dbxSvcAgentDSOPathPrefix = System.getProperty("dbxSvcAgentDSOPathPrefix");
      if (dbxSvcAgentDSOPathPrefix == null) {
        dbxSvcAgentDSOPathPrefix = "/net/jano.sfbay/export/disk05/hotspot/sa";
      }
      if (cpu.equals("sparc")) {
        dbxSvcAgentDSOPathNames = new String[] { dbxSvcAgentDSOPathPrefix + fileSep + os + fileSep + cpu + "v9" + fileSep + "lib" + fileSep + "libsvc_agent_dbx.so", dbxSvcAgentDSOPathPrefix + fileSep + os + fileSep + cpu + fileSep + "lib" + fileSep + "libsvc_agent_dbx.so" };
      } else {
        dbxSvcAgentDSOPathNames = new String[] { dbxSvcAgentDSOPathPrefix + fileSep + os + fileSep + cpu + fileSep + "lib" + fileSep + "libsvc_agent_dbx.so" };
      }
    }
    DbxDebuggerLocal dbg = new DbxDebuggerLocal(null, dbxPathName, dbxSvcAgentDSOPathNames, !isServer);
    debugger = dbg;
    
    attachDebugger();
    if (cpu.equals("x86"))
    {
      machDesc = new MachineDescriptionIntelX86();
    }
    else if (cpu.equals("sparc"))
    {
      int addressSize = dbg.getRemoteProcessAddressSize();
      if (addressSize == -1) {
        throw new DebuggerException("Error occurred while trying to determine the remote process's address size. It's possible that the Serviceability Agent's dbx module failed to initialize. Examine the standard output and standard error streams from the dbx process for more information.");
      }
      if (addressSize == 32) {
        machDesc = new MachineDescriptionSPARC32Bit();
      } else if (addressSize == 64) {
        machDesc = new MachineDescriptionSPARC64Bit();
      } else {
        throw new DebuggerException("Address size " + addressSize + " is not supported on SPARC");
      }
    }
    dbg.setMachineDescription(machDesc);
  }
  
  private void connectRemoteDebugger()
    throws DebuggerException
  {
    RemoteDebugger remote = (RemoteDebugger)RMIHelper.lookup(debugServerID);
    
    debugger = new RemoteDebuggerClient(remote);
    machDesc = ((RemoteDebuggerClient)debugger).getMachineDescription();
    os = debugger.getOS();
    if (os.equals("solaris")) {
      setupJVMLibNamesSolaris();
    } else if (os.equals("win32")) {
      setupJVMLibNamesWin32();
    } else if (os.equals("linux")) {
      setupJVMLibNamesLinux();
    } else {
      throw new RuntimeException("Unknown OS type");
    }
    cpu = debugger.getCPU();
  }
  
  private void setupJVMLibNamesSolaris()
  {
    jvmLibNames = new String[] { "libjvm.so", "libjvm_g.so", "gamma_g" };
  }
  
  private void setupDebuggerWin32()
  {
    setupJVMLibNamesWin32();
    if (cpu.equals("x86")) {
      machDesc = new MachineDescriptionIntelX86();
    } else if (cpu.equals("amd64")) {
      machDesc = new MachineDescriptionAMD64();
    } else if (cpu.equals("ia64")) {
      machDesc = new MachineDescriptionIA64();
    } else {
      throw new DebuggerException("Win32 supported under x86, amd64 and ia64 only");
    }
    if (System.getProperty("sun.jvm.hotspot.debugger.useWindbgDebugger") != null) {
      debugger = new WindbgDebuggerLocal(machDesc, !isServer);
    } else {
      debugger = new Win32DebuggerLocal(machDesc, !isServer);
    }
    attachDebugger();
  }
  
  private void setupJVMLibNamesWin32()
  {
    jvmLibNames = new String[] { "jvm.dll", "jvm_g.dll" };
  }
  
  private void setupDebuggerLinux()
  {
    setupJVMLibNamesLinux();
    if (cpu.equals("x86")) {
      machDesc = new MachineDescriptionIntelX86();
    } else if (cpu.equals("ia64")) {
      machDesc = new MachineDescriptionIA64();
    } else if (cpu.equals("amd64")) {
      machDesc = new MachineDescriptionAMD64();
    } else if (cpu.equals("sparc"))
    {
      if (LinuxDebuggerLocal.getAddressSize() == 8) {
        machDesc = new MachineDescriptionSPARC64Bit();
      } else {
        machDesc = new MachineDescriptionSPARC32Bit();
      }
    }
    else {
      throw new DebuggerException("Linux only supported on x86/ia64/amd64/sparc/sparc64");
    }
    LinuxDebuggerLocal dbg = new LinuxDebuggerLocal(machDesc, !isServer);
    
    debugger = dbg;
    
    attachDebugger();
  }
  
  private void setupJVMLibNamesLinux()
  {
    jvmLibNames = new String[] { "libjvm.so", "libjvm_g.so" };
  }
  
  private void attachDebugger()
  {
    if (startupMode == 0) {
      debugger.attach(pid);
    } else if (startupMode == 1) {
      debugger.attach(javaExecutableName, coreFileName);
    } else {
      throw new DebuggerException("Should not call attach() for startupMode == " + startupMode);
    }
  }
}

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

import sun.jvm.hotspot.debugger.SymbolLookup;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.basic.BasicVtblAccess;

public class HotSpotSolarisVtblAccess
  extends BasicVtblAccess
{
  public HotSpotSolarisVtblAccess(SymbolLookup symbolLookup, String[] jvmLibNames)
  {
    super(symbolLookup, jvmLibNames);
  }
  
  protected String vtblSymbolForType(Type type)
  {
    String demangledSymbol = type.getName() + "::__vtbl";
    return mangle(demangledSymbol);
  }
  
  private String mangle(String symbol)
  {
    String[] parts = symbol.split("::");
    StringBuffer mangled = new StringBuffer("__1c");
    for (int i = 0; i < parts.length; i++)
    {
      int len = parts[i].length();
      if (len >= 26)
      {
        mangled.append((char)(97 + len / 26));
        len %= 26;
      }
      mangled.append((char)(65 + len));
      mangled.append(parts[i]);
    }
    mangled.append("_");
    return mangled.toString();
  }
}

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

import java.io.PrintStream;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.Debugger;
import sun.jvm.hotspot.debugger.MachineDescription;
import sun.jvm.hotspot.debugger.NoSuchSymbolException;
import sun.jvm.hotspot.types.CIntegerType;
import sun.jvm.hotspot.types.Field;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.basic.BasicCIntegerField;
import sun.jvm.hotspot.types.basic.BasicCIntegerType;
import sun.jvm.hotspot.types.basic.BasicField;
import sun.jvm.hotspot.types.basic.BasicJBooleanField;
import sun.jvm.hotspot.types.basic.BasicJByteField;
import sun.jvm.hotspot.types.basic.BasicJCharField;
import sun.jvm.hotspot.types.basic.BasicJDoubleField;
import sun.jvm.hotspot.types.basic.BasicJFloatField;
import sun.jvm.hotspot.types.basic.BasicJIntField;
import sun.jvm.hotspot.types.basic.BasicJLongField;
import sun.jvm.hotspot.types.basic.BasicJShortField;
import sun.jvm.hotspot.types.basic.BasicOopField;
import sun.jvm.hotspot.types.basic.BasicPointerType;
import sun.jvm.hotspot.types.basic.BasicType;
import sun.jvm.hotspot.types.basic.BasicTypeDataBase;
import sun.jvm.hotspot.types.basic.VtblAccess;
import sun.jvm.hotspot.utilities.CStringUtilities;

public class HotSpotTypeDataBase
  extends BasicTypeDataBase
{
  private Debugger symbolLookup;
  private String[] jvmLibNames;
  private static final int UNINITIALIZED_SIZE = -1;
  private static final int C_INT8_SIZE = 1;
  private static final int C_INT32_SIZE = 4;
  private static final int C_INT64_SIZE = 8;
  private static final boolean DEBUG = System.getProperty("sun.jvm.hotspot.HotSpotTypeDataBase.DEBUG") != null;
  
  public HotSpotTypeDataBase(MachineDescription machDesc, VtblAccess vtblAccess, Debugger symbolLookup, String[] jvmLibNames)
    throws NoSuchSymbolException
  {
    super(machDesc, vtblAccess);
    this.symbolLookup = symbolLookup;
    this.jvmLibNames = jvmLibNames;
    
    readVMTypes();
    initializePrimitiveTypes();
    readVMStructs();
    readVMIntConstants();
    readVMLongConstants();
  }
  
  private void readVMTypes()
  {
    Address entryAddr = lookupInProcess("gHotSpotVMTypes");
    
    entryAddr = entryAddr.getAddressAt(0L);
    if (entryAddr == null) {
      throw new RuntimeException("gHotSpotVMTypes was not initialized properly in the remote process; can not continue");
    }
    long typeEntryTypeNameOffset = getLongValueFromProcess("gHotSpotVMTypeEntryTypeNameOffset");
    long typeEntrySuperclassNameOffset = getLongValueFromProcess("gHotSpotVMTypeEntrySuperclassNameOffset");
    long typeEntryIsOopTypeOffset = getLongValueFromProcess("gHotSpotVMTypeEntryIsOopTypeOffset");
    long typeEntryIsIntegerTypeOffset = getLongValueFromProcess("gHotSpotVMTypeEntryIsIntegerTypeOffset");
    long typeEntryIsUnsignedOffset = getLongValueFromProcess("gHotSpotVMTypeEntryIsUnsignedOffset");
    long typeEntrySizeOffset = getLongValueFromProcess("gHotSpotVMTypeEntrySizeOffset");
    long typeEntryArrayStride = getLongValueFromProcess("gHotSpotVMTypeEntryArrayStride");
    
    Address typeNameAddr = null;
    do
    {
      typeNameAddr = entryAddr.getAddressAt(typeEntryTypeNameOffset);
      if (typeNameAddr != null)
      {
        String typeName = CStringUtilities.getString(typeNameAddr);
        
        String superclassName = null;
        Address superclassNameAddr = entryAddr.getAddressAt(typeEntrySuperclassNameOffset);
        if (superclassNameAddr != null) {
          superclassName = CStringUtilities.getString(superclassNameAddr);
        }
        boolean isOopType = entryAddr.getCIntegerAt(typeEntryIsOopTypeOffset, 4L, false) != 0L;
        boolean isIntegerType = entryAddr.getCIntegerAt(typeEntryIsIntegerTypeOffset, 4L, false) != 0L;
        boolean isUnsigned = entryAddr.getCIntegerAt(typeEntryIsUnsignedOffset, 4L, false) != 0L;
        long size = entryAddr.getCIntegerAt(typeEntrySizeOffset, 8L, true);
        
        createType(typeName, superclassName, isOopType, isIntegerType, isUnsigned, size);
      }
      entryAddr = entryAddr.addOffsetTo(typeEntryArrayStride);
    } while (typeNameAddr != null);
  }
  
  private void initializePrimitiveTypes()
  {
    setJBooleanType(lookupPrimitiveType("jboolean"));
    setJByteType(lookupPrimitiveType("jbyte"));
    setJCharType(lookupPrimitiveType("jchar"));
    setJDoubleType(lookupPrimitiveType("jdouble"));
    setJFloatType(lookupPrimitiveType("jfloat"));
    setJIntType(lookupPrimitiveType("jint"));
    setJLongType(lookupPrimitiveType("jlong"));
    setJShortType(lookupPrimitiveType("jshort"));
    
    ((BasicType)getJBooleanType()).setIsJavaPrimitiveType(true);
    ((BasicType)getJByteType()).setIsJavaPrimitiveType(true);
    ((BasicType)getJCharType()).setIsJavaPrimitiveType(true);
    ((BasicType)getJDoubleType()).setIsJavaPrimitiveType(true);
    ((BasicType)getJFloatType()).setIsJavaPrimitiveType(true);
    ((BasicType)getJIntType()).setIsJavaPrimitiveType(true);
    ((BasicType)getJLongType()).setIsJavaPrimitiveType(true);
    ((BasicType)getJShortType()).setIsJavaPrimitiveType(true);
  }
  
  private Type lookupPrimitiveType(String typeName)
  {
    Type type = lookupType(typeName, false);
    if (type == null) {
      throw new RuntimeException("Error initializing the HotSpotDataBase: could not find the primitive type \"" + typeName + "\" in the remote VM's VMStructs table. This type is required in " + "order to determine the size of Java primitive types. Can not continue.");
    }
    return type;
  }
  
  private void readVMStructs()
  {
    long structEntryTypeNameOffset = getLongValueFromProcess("gHotSpotVMStructEntryTypeNameOffset");
    long structEntryFieldNameOffset = getLongValueFromProcess("gHotSpotVMStructEntryFieldNameOffset");
    long structEntryTypeStringOffset = getLongValueFromProcess("gHotSpotVMStructEntryTypeStringOffset");
    long structEntryIsStaticOffset = getLongValueFromProcess("gHotSpotVMStructEntryIsStaticOffset");
    long structEntryOffsetOffset = getLongValueFromProcess("gHotSpotVMStructEntryOffsetOffset");
    long structEntryAddressOffset = getLongValueFromProcess("gHotSpotVMStructEntryAddressOffset");
    long structEntryArrayStride = getLongValueFromProcess("gHotSpotVMStructEntryArrayStride");
    
    Address entryAddr = lookupInProcess("gHotSpotVMStructs");
    
    entryAddr = entryAddr.getAddressAt(0L);
    if (entryAddr == null) {
      throw new RuntimeException("gHotSpotVMStructs was not initialized properly in the remote process; can not continue");
    }
    Address fieldNameAddr = null;
    String typeName = null;
    String fieldName = null;
    String typeString = null;
    boolean isStatic = false;
    long offset = 0L;
    Address staticFieldAddr = null;
    long size = 0L;
    long index = 0L;
    String opaqueName = "<opaque>";
    lookupOrCreateClass(opaqueName, false, false, false);
    do
    {
      fieldNameAddr = entryAddr.getAddressAt(structEntryFieldNameOffset);
      if (fieldNameAddr != null)
      {
        fieldName = CStringUtilities.getString(fieldNameAddr);
        
        Address addr = entryAddr.getAddressAt(structEntryTypeNameOffset);
        if (addr == null) {
          throw new RuntimeException("gHotSpotVMStructs unexpectedly had a NULL type name at index " + index);
        }
        typeName = CStringUtilities.getString(addr);
        
        addr = entryAddr.getAddressAt(structEntryTypeStringOffset);
        if (addr == null) {
          typeString = opaqueName;
        } else {
          typeString = CStringUtilities.getString(addr);
        }
        isStatic = entryAddr.getCIntegerAt(structEntryIsStaticOffset, 4L, false) != 0L;
        if (isStatic)
        {
          staticFieldAddr = entryAddr.getAddressAt(structEntryAddressOffset);
          offset = 0L;
        }
        else
        {
          offset = entryAddr.getCIntegerAt(structEntryOffsetOffset, 8L, true);
          staticFieldAddr = null;
        }
        BasicType containingType = lookupOrFail(typeName);
        
        BasicType fieldType = lookupOrFail(typeString);
        
        createField(containingType, fieldName, fieldType, isStatic, offset, staticFieldAddr);
      }
      index += 1L;
      entryAddr = entryAddr.addOffsetTo(structEntryArrayStride);
    } while (fieldNameAddr != null);
  }
  
  private void readVMIntConstants()
  {
    long intConstantEntryNameOffset = getLongValueFromProcess("gHotSpotVMIntConstantEntryNameOffset");
    long intConstantEntryValueOffset = getLongValueFromProcess("gHotSpotVMIntConstantEntryValueOffset");
    long intConstantEntryArrayStride = getLongValueFromProcess("gHotSpotVMIntConstantEntryArrayStride");
    
    Address entryAddr = lookupInProcess("gHotSpotVMIntConstants");
    
    entryAddr = entryAddr.getAddressAt(0L);
    if (entryAddr == null) {
      throw new RuntimeException("gHotSpotVMIntConstants was not initialized properly in the remote process; can not continue");
    }
    Address nameAddr = null;
    do
    {
      nameAddr = entryAddr.getAddressAt(intConstantEntryNameOffset);
      if (nameAddr != null)
      {
        String name = CStringUtilities.getString(nameAddr);
        int value = (int)entryAddr.getCIntegerAt(intConstantEntryValueOffset, 4L, false);
        
        Integer oldValue = lookupIntConstant(name, false);
        if (oldValue == null)
        {
          addIntConstant(name, value);
        }
        else
        {
          if (oldValue.intValue() != value) {
            throw new RuntimeException("Error: the integer constant \"" + name + "\" had its value redefined (old was " + oldValue + ", new is " + value + ". Aborting.");
          }
          System.err.println("Warning: the int constant \"" + name + "\" (declared in the remote VM in VMStructs::localHotSpotVMIntConstants) " + "had its value declared as " + value + " twice. Continuing.");
        }
      }
      entryAddr = entryAddr.addOffsetTo(intConstantEntryArrayStride);
    } while (nameAddr != null);
  }
  
  private void readVMLongConstants()
  {
    long longConstantEntryNameOffset = getLongValueFromProcess("gHotSpotVMLongConstantEntryNameOffset");
    long longConstantEntryValueOffset = getLongValueFromProcess("gHotSpotVMLongConstantEntryValueOffset");
    long longConstantEntryArrayStride = getLongValueFromProcess("gHotSpotVMLongConstantEntryArrayStride");
    
    Address entryAddr = lookupInProcess("gHotSpotVMLongConstants");
    
    entryAddr = entryAddr.getAddressAt(0L);
    if (entryAddr == null) {
      throw new RuntimeException("gHotSpotVMLongConstants was not initialized properly in the remote process; can not continue");
    }
    Address nameAddr = null;
    do
    {
      nameAddr = entryAddr.getAddressAt(longConstantEntryNameOffset);
      if (nameAddr != null)
      {
        String name = CStringUtilities.getString(nameAddr);
        int value = (int)entryAddr.getCIntegerAt(longConstantEntryValueOffset, 8L, true);
        
        Long oldValue = lookupLongConstant(name, false);
        if (oldValue == null)
        {
          addLongConstant(name, value);
        }
        else
        {
          if (oldValue.longValue() != value) {
            throw new RuntimeException("Error: the long constant \"" + name + "\" had its value redefined (old was " + oldValue + ", new is " + value + ". Aborting.");
          }
          System.err.println("Warning: the long constant \"" + name + "\" (declared in the remote VM in VMStructs::localHotSpotVMLongConstants) " + "had its value declared as " + value + " twice. Continuing.");
        }
      }
      entryAddr = entryAddr.addOffsetTo(longConstantEntryArrayStride);
    } while (nameAddr != null);
  }
  
  private BasicType lookupOrFail(String typeName)
  {
    BasicType type = (BasicType)lookupType(typeName, false);
    if (type == null) {
      throw new RuntimeException("Type \"" + typeName + "\", referenced in VMStructs::localHotSpotVMStructs in the remote VM, " + "was not present in the remote VMStructs::localHotSpotVMTypes table (should have been caught " + "in the debug build of that VM). Can not continue.");
    }
    return type;
  }
  
  private long getLongValueFromProcess(String symbol)
  {
    return lookupInProcess(symbol).getCIntegerAt(0L, 8L, true);
  }
  
  private Address lookupInProcess(String symbol)
    throws NoSuchSymbolException
  {
    for (int i = 0; i < jvmLibNames.length; i++)
    {
      Address addr = symbolLookup.lookup(jvmLibNames[i], symbol);
      if (addr != null) {
        return addr;
      }
    }
    String errStr = "(";
    for (int i = 0; i < jvmLibNames.length; i++)
    {
      errStr = errStr + jvmLibNames[i];
      if (i < jvmLibNames.length - 1) {
        errStr = errStr + ", ";
      }
    }
    errStr = errStr + ")";
    throw new NoSuchSymbolException(symbol, "Could not find symbol \"" + symbol + "\" in any of the known library names " + errStr);
  }
  
  private BasicType lookupOrCreateClass(String typeName, boolean isOopType, boolean isIntegerType, boolean isUnsigned)
  {
    BasicType type = (BasicType)lookupType(typeName, false);
    if (type == null) {
      type = createBasicType(typeName, isOopType, isIntegerType, isUnsigned);
    }
    return type;
  }
  
  private BasicType createBasicType(String typeName, boolean isOopType, boolean isIntegerType, boolean isUnsigned)
  {
    BasicType type = null;
    if (isIntegerType)
    {
      type = new BasicCIntegerType(this, typeName, isUnsigned);
    }
    else
    {
      if (typeNameIsPointerType(typeName)) {
        type = recursiveCreateBasicPointerType(typeName);
      } else {
        type = new BasicType(this, typeName);
      }
      if (isOopType) {
        if (typeName.equals("markOop")) {
          type = new BasicCIntegerType(this, typeName, true);
        } else {
          type.setIsOopType(true);
        }
      }
    }
    type.setSize(-1L);
    addType(type);
    return type;
  }
  
  private BasicPointerType recursiveCreateBasicPointerType(String typeName)
  {
    String targetTypeName = typeName.substring(0, typeName.lastIndexOf('*')).trim();
    Type targetType = null;
    if (typeNameIsPointerType(targetTypeName))
    {
      targetType = recursiveCreateBasicPointerType(targetTypeName);
    }
    else
    {
      targetType = lookupType(targetTypeName, false);
      if (targetType == null) {
        if ((targetTypeName.equals("char")) || (targetTypeName.equals("const char")))
        {
          BasicType basicTargetType = createBasicType(targetTypeName, false, true, false);
          basicTargetType.setSize(1L);
          targetType = basicTargetType;
        }
        else if (targetTypeName.equals("u_char"))
        {
          BasicType basicTargetType = createBasicType(targetTypeName, false, true, true);
          basicTargetType.setSize(1L);
          targetType = basicTargetType;
        }
        else
        {
          if (DEBUG) {
            System.err.println("WARNING: missing target type \"" + targetTypeName + "\" for pointer type \"" + typeName + "\"");
          }
          targetType = createBasicType(targetTypeName, false, false, false);
        }
      }
    }
    return new BasicPointerType(this, typeName, targetType);
  }
  
  private boolean typeNameIsPointerType(String typeName)
  {
    int i = typeName.length() - 1;
    while ((i >= 0) && (Character.isWhitespace(typeName.charAt(i)))) {
      i--;
    }
    if ((i >= 0) && (typeName.charAt(i) == '*')) {
      return true;
    }
    return false;
  }
  
  public void createType(String typeName, String superclassName, boolean isOopType, boolean isIntegerType, boolean isUnsigned, long size)
  {
    BasicType superclass = null;
    if (superclassName != null) {
      superclass = lookupOrCreateClass(superclassName, false, false, false);
    }
    BasicType curType = lookupOrCreateClass(typeName, isOopType, isIntegerType, isUnsigned);
    if (superclass != null)
    {
      if (curType.getSuperclass() == null) {
        curType.setSuperclass(superclass);
      }
      if (curType.getSuperclass() != superclass) {
        throw new RuntimeException("Error: the type \"" + typeName + "\" (declared in the remote VM in VMStructs::localHotSpotVMTypes) " + "had its superclass redefined (old was " + curType.getSuperclass().getName() + ", new is " + superclass.getName() + ").");
      }
    }
    if (curType.getSize() == -1L)
    {
      curType.setSize(size);
    }
    else
    {
      if (curType.getSize() != size) {
        throw new RuntimeException("Error: the type \"" + typeName + "\" (declared in the remote VM in VMStructs::localHotSpotVMTypes) " + "had its size redefined (old was " + curType.getSize() + ", new is " + size + ").");
      }
      System.err.println("Warning: the type \"" + typeName + "\" (declared in the remote VM in VMStructs::localHotSpotVMTypes) " + "had its size declared as " + size + " twice. Continuing.");
    }
  }
  
  public void createField(BasicType containingType, String name, Type type, boolean isStatic, long offset, Address staticFieldAddress)
  {
    containingType.addField(internalCreateField(containingType, name, type, isStatic, offset, staticFieldAddress));
  }
  
  Field internalCreateField(BasicType containingType, String name, Type type, boolean isStatic, long offset, Address staticFieldAddress)
  {
    if (type.isOopType()) {
      return new BasicOopField(this, containingType, name, type, isStatic, offset, staticFieldAddress);
    }
    if ((type instanceof CIntegerType)) {
      return new BasicCIntegerField(this, containingType, name, type, isStatic, offset, staticFieldAddress);
    }
    if (type.equals(getJBooleanType())) {
      return new BasicJBooleanField(this, containingType, name, type, isStatic, offset, staticFieldAddress);
    }
    if (type.equals(getJByteType())) {
      return new BasicJByteField(this, containingType, name, type, isStatic, offset, staticFieldAddress);
    }
    if (type.equals(getJCharType())) {
      return new BasicJCharField(this, containingType, name, type, isStatic, offset, staticFieldAddress);
    }
    if (type.equals(getJDoubleType())) {
      return new BasicJDoubleField(this, containingType, name, type, isStatic, offset, staticFieldAddress);
    }
    if (type.equals(getJFloatType())) {
      return new BasicJFloatField(this, containingType, name, type, isStatic, offset, staticFieldAddress);
    }
    if (type.equals(getJIntType())) {
      return new BasicJIntField(this, containingType, name, type, isStatic, offset, staticFieldAddress);
    }
    if (type.equals(getJLongType())) {
      return new BasicJLongField(this, containingType, name, type, isStatic, offset, staticFieldAddress);
    }
    if (type.equals(getJShortType())) {
      return new BasicJShortField(this, containingType, name, type, isStatic, offset, staticFieldAddress);
    }
    return new BasicField(this, containingType, name, type, isStatic, offset, staticFieldAddress);
  }
  
  private void dumpMemory(Address addr, int len)
  {
    int i = 0;
    while (i < len)
    {
      System.err.print(addr.addOffsetTo(i) + ":");
      for (int j = 0; (j < 8) && (i < len); j++)
      {
        String s = Long.toHexString(addr.getCIntegerAt(i, 1L, true));
        System.err.print(" 0x");
        for (int k = 0; k < 2 - s.length(); k++) {
          System.err.print("0");
        }
        System.err.print(s);i++;
      }
      System.err.println();
    }
  }
}

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

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

final class HSDB$1
  implements ActionListener
{
  private final HSDB this$0;
  
  HSDB$1(HSDB paramHSDB) {}
  
  public void actionPerformed(ActionEvent e)
  {
    HSDB.access$000(this$0);
  }
}

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

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

final class HSDB$10
  implements ActionListener
{
  private final HSDB this$0;
  
  HSDB$10(HSDB paramHSDB) {}
  
  public void actionPerformed(ActionEvent e)
  {
    HSDB.access$600(this$0);
  }
}

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

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

final class HSDB$11
  implements ActionListener
{
  private final HSDB this$0;
  
  HSDB$11(HSDB paramHSDB) {}
  
  public void actionPerformed(ActionEvent e)
  {
    HSDB.access$700(this$0);
  }
}

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

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

final class HSDB$12
  implements ActionListener
{
  private final HSDB this$0;
  
  HSDB$12(HSDB paramHSDB) {}
  
  public void actionPerformed(ActionEvent e)
  {
    HSDB.access$800(this$0);
  }
}

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

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

final class HSDB$13
  implements ActionListener
{
  private final HSDB this$0;
  
  HSDB$13(HSDB paramHSDB) {}
  
  public void actionPerformed(ActionEvent e)
  {
    HSDB.access$900(this$0);
  }
}

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

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

final class HSDB$14
  implements ActionListener
{
  private final HSDB this$0;
  
  HSDB$14(HSDB paramHSDB) {}
  
  public void actionPerformed(ActionEvent e)
  {
    HSDB.access$1000(this$0);
  }
}

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

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

final class HSDB$15
  implements ActionListener
{
  private final HSDB this$0;
  
  HSDB$15(HSDB paramHSDB) {}
  
  public void actionPerformed(ActionEvent e)
  {
    this$0.showInspector(null);
  }
}

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

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

final class HSDB$16
  implements ActionListener
{
  private final HSDB this$0;
  
  HSDB$16(HSDB paramHSDB) {}
  
  public void actionPerformed(ActionEvent e)
  {
    this$0.showMemoryViewer();
  }
}

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

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

final class HSDB$17
  implements ActionListener
{
  private final HSDB this$0;
  
  HSDB$17(HSDB paramHSDB) {}
  
  public void actionPerformed(ActionEvent e)
  {
    HSDB.access$1100(this$0);
  }
}

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

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

final class HSDB$18
  implements ActionListener
{
  private final HSDB this$0;
  
  HSDB$18(HSDB paramHSDB) {}
  
  public void actionPerformed(ActionEvent e)
  {
    HSDB.access$1200(this$0);
  }
}

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

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

final class HSDB$19
  implements ActionListener
{
  private final HSDB this$0;
  
  HSDB$19(HSDB paramHSDB) {}
  
  public void actionPerformed(ActionEvent e)
  {
    this$0.showSystemProperties();
  }
}

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

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

final class HSDB$2
  implements ActionListener
{
  private final HSDB this$0;
  
  HSDB$2(HSDB paramHSDB) {}
  
  public void actionPerformed(ActionEvent e)
  {
    HSDB.access$100(this$0);
  }
}

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

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

final class HSDB$20
  implements ActionListener
{
  private final HSDB this$0;
  
  HSDB$20(HSDB paramHSDB) {}
  
  public void actionPerformed(ActionEvent e)
  {
    this$0.showVMVersion();
  }
}

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

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

final class HSDB$21
  implements ActionListener
{
  private final HSDB this$0;
  
  HSDB$21(HSDB paramHSDB) {}
  
  public void actionPerformed(ActionEvent e)
  {
    this$0.showCommandLineFlags();
  }
}

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

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

final class HSDB$22
  implements ActionListener
{
  private final HSDB this$0;
  
  HSDB$22(HSDB paramHSDB) {}
  
  public void actionPerformed(ActionEvent e)
  {
    HSDB.access$1300(this$0);
  }
}

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

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

final class HSDB$23
  implements ActionListener
{
  private final HSDB this$0;
  
  HSDB$23(HSDB paramHSDB) {}
  
  public void actionPerformed(ActionEvent e)
  {
    HSDB.access$1400(this$0);
  }
}

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

final class HSDB$24
  extends Thread
{
  private final HSDB this$0;
  
  HSDB$24(HSDB paramHSDB) {}
  
  public void run()
  {
    HSDB.access$1500(this$0);
  }
}

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

import javax.swing.JTextField;

final class HSDB$25$1
  implements Runnable
{
  private final HSDB.25 this$1;
  
  HSDB$25$1(HSDB.25 param25) {}
  
  public void run()
  {
    HSDB.access$1900(HSDB.25.access$1800(this$1), HSDB.25.access$1700(this$1).getText());
  }
}

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

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JDesktopPane;
import javax.swing.JInternalFrame;
import javax.swing.JTextField;
import sun.jvm.hotspot.utilities.WorkerThread;

final class HSDB$25
  implements ActionListener
{
  private final HSDB this$0;
  
  HSDB$25(HSDB paramHSDB, JInternalFrame paramJInternalFrame, JTextField paramJTextField) {}
  
  public void actionPerformed(ActionEvent e)
  {
    val$attachDialog.setVisible(false);
    HSDB.access$1600(this$0).remove(val$attachDialog);
    HSDB.access$2000(this$0).invokeLater(new Runnable()
    {
      public void run()
      {
        HSDB.access$1900(this$0, val$pidTextField.getText());
      }
    });
  }
}

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

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JDesktopPane;
import javax.swing.JInternalFrame;

final class HSDB$26
  implements ActionListener
{
  private final HSDB this$0;
  
  HSDB$26(HSDB paramHSDB, JInternalFrame paramJInternalFrame) {}
  
  public void actionPerformed(ActionEvent e)
  {
    val$attachDialog.setVisible(false);
    HSDB.access$1600(this$0).remove(val$attachDialog);
    HSDB.access$2200(this$0, HSDB.access$2100(this$0), true);
  }
}

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

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import javax.swing.JFileChooser;
import javax.swing.JInternalFrame;
import javax.swing.JTextField;

final class HSDB$27
  implements ActionListener
{
  private final HSDB this$0;
  
  HSDB$27(HSDB paramHSDB, JInternalFrame paramJInternalFrame, JTextField paramJTextField) {}
  
  public void actionPerformed(ActionEvent e)
  {
    JFileChooser fileChooser = new JFileChooser(new File("."));
    int retVal = fileChooser.showOpenDialog(val$dialog);
    if (retVal == 0) {
      val$corePathField.setText(fileChooser.getSelectedFile().getPath());
    }
  }
}

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

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import javax.swing.JFileChooser;
import javax.swing.JInternalFrame;
import javax.swing.JTextField;

final class HSDB$28
  implements ActionListener
{
  private final HSDB this$0;
  
  HSDB$28(HSDB paramHSDB, JInternalFrame paramJInternalFrame, JTextField paramJTextField) {}
  
  public void actionPerformed(ActionEvent e)
  {
    JFileChooser fileChooser = new JFileChooser(new File("."));
    int retVal = fileChooser.showOpenDialog(val$dialog);
    if (retVal == 0) {
      val$execPathField.setText(fileChooser.getSelectedFile().getPath());
    }
  }
}

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

import javax.swing.JTextField;

final class HSDB$29$1
  implements Runnable
{
  private final HSDB.29 this$1;
  
  HSDB$29$1(HSDB.29 param29) {}
  
  public void run()
  {
    HSDB.access$2600(HSDB.29.access$2500(this$1), HSDB.29.access$2300(this$1).getText(), HSDB.29.access$24
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