sa-jdi

heck(!n2.lessThan(n1), "lessThan 16");
    
    check(p1.lessThanOrEqual(p1), "lessThanOrEqual 1");
    check(p2.lessThanOrEqual(p2), "lessThanOrEqual 2");
    check(n1.lessThanOrEqual(n1), "lessThanOrEqual 3");
    check(n2.lessThanOrEqual(n2), "lessThanOrEqual 4");
    
    check(p1.lessThanOrEqual(p2), "lessThanOrEqual 5");
    check(p1.lessThanOrEqual(n1), "lessThanOrEqual 6");
    check(p1.lessThanOrEqual(n2), "lessThanOrEqual 7");
    check(p2.lessThanOrEqual(n1), "lessThanOrEqual 8");
    check(p2.lessThanOrEqual(n2), "lessThanOrEqual 9");
    check(n1.lessThanOrEqual(n2), "lessThanOrEqual 10");
    
    check(!p2.lessThanOrEqual(p1), "lessThanOrEqual 11");
    check(!n1.lessThanOrEqual(p1), "lessThanOrEqual 12");
    check(!n2.lessThanOrEqual(p1), "lessThanOrEqual 13");
    check(!n1.lessThanOrEqual(p2), "lessThanOrEqual 14");
    check(!n2.lessThanOrEqual(p2), "lessThanOrEqual 15");
    check(!n2.lessThanOrEqual(n1), "lessThanOrEqual 16");
    
    check(n2.greaterThan(p1), "greaterThan 1");
    check(n2.greaterThan(p2), "greaterThan 2");
    check(n2.greaterThan(n1), "greaterThan 3");
    check(n1.greaterThan(p1), "greaterThan 4");
    check(n1.greaterThan(p2), "greaterThan 5");
    check(p2.greaterThan(p1), "greaterThan 6");
    
    check(!p1.greaterThan(p1), "greaterThan 7");
    check(!p2.greaterThan(p2), "greaterThan 8");
    check(!n1.greaterThan(n1), "greaterThan 9");
    check(!n2.greaterThan(n2), "greaterThan 10");
    
    check(!p1.greaterThan(n2), "greaterThan 11");
    check(!p2.greaterThan(n2), "greaterThan 12");
    check(!n1.greaterThan(n2), "greaterThan 13");
    check(!p1.greaterThan(n1), "greaterThan 14");
    check(!p2.greaterThan(n1), "greaterThan 15");
    check(!p1.greaterThan(p2), "greaterThan 16");
    
    check(p1.greaterThanOrEqual(p1), "greaterThanOrEqual 1");
    check(p2.greaterThanOrEqual(p2), "greaterThanOrEqual 2");
    check(n1.greaterThanOrEqual(n1), "greaterThanOrEqual 3");
    check(n2.greaterThanOrEqual(n2), "greaterThanOrEqual 4");
    
    check(n2.greaterThanOrEqual(p1), "greaterThanOrEqual 5");
    check(n2.greaterThanOrEqual(p2), "greaterThanOrEqual 6");
    check(n2.greaterThanOrEqual(n1), "greaterThanOrEqual 7");
    check(n1.greaterThanOrEqual(p1), "greaterThanOrEqual 8");
    check(n1.greaterThanOrEqual(p2), "greaterThanOrEqual 9");
    check(p2.greaterThanOrEqual(p1), "greaterThanOrEqual 10");
    
    check(!p1.greaterThanOrEqual(n2), "greaterThanOrEqual 11");
    check(!p2.greaterThanOrEqual(n2), "greaterThanOrEqual 12");
    check(!n1.greaterThanOrEqual(n2), "greaterThanOrEqual 13");
    check(!p1.greaterThanOrEqual(n1), "greaterThanOrEqual 14");
    check(!p2.greaterThanOrEqual(n1), "greaterThanOrEqual 15");
    check(!p1.greaterThanOrEqual(p2), "greaterThanOrEqual 16");
    
    System.err.println("Win32Address: all tests passed successfully.");
  }
}

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

import java.io.File;
import java.util.Iterator;
import java.util.List;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.DebuggerException;
import sun.jvm.hotspot.debugger.ThreadProxy;
import sun.jvm.hotspot.debugger.cdbg.CDebugger;
import sun.jvm.hotspot.debugger.cdbg.CFrame;
import sun.jvm.hotspot.debugger.cdbg.DebugEvent;
import sun.jvm.hotspot.debugger.cdbg.LoadObject;
import sun.jvm.hotspot.debugger.cdbg.ProcessControl;
import sun.jvm.hotspot.debugger.cdbg.basic.x86.X86CFrame;
import sun.jvm.hotspot.debugger.x86.X86ThreadContext;
import sun.jvm.hotspot.utilities.AddressOps;

class Win32CDebugger
  implements CDebugger, ProcessControl
{
  private Win32Debugger dbg;
  
  Win32CDebugger(Win32Debugger dbg)
  {
    this.dbg = dbg;
  }
  
  public List getThreadList()
    throws DebuggerException
  {
    return dbg.getThreadList();
  }
  
  public List getLoadObjectList()
    throws DebuggerException
  {
    return dbg.getLoadObjectList();
  }
  
  public LoadObject loadObjectContainingPC(Address pc)
    throws DebuggerException
  {
    if (pc == null) {
      return null;
    }
    List objs = getLoadObjectList();
    for (Iterator iter = objs.iterator(); iter.hasNext();)
    {
      LoadObject obj = (LoadObject)iter.next();
      if ((AddressOps.lte(obj.getBase(), pc)) && (pc.minus(obj.getBase()) < obj.getSize())) {
        return obj;
      }
    }
    return null;
  }
  
  public CFrame topFrameForThread(ThreadProxy thread)
    throws DebuggerException
  {
    X86ThreadContext context = (X86ThreadContext)thread.getContext();
    Address ebp = context.getRegisterAsAddress(6);
    if (ebp == null) {
      return null;
    }
    Address pc = context.getRegisterAsAddress(14);
    if (pc == null) {
      return null;
    }
    return new X86CFrame(this, ebp, pc);
  }
  
  public String getNameOfFile(String fileName)
  {
    return new File(fileName).getName();
  }
  
  public ProcessControl getProcessControl()
    throws DebuggerException
  {
    return this;
  }
  
  public boolean canDemangle()
  {
    return false;
  }
  
  public String demangle(String sym)
  {
    throw new UnsupportedOperationException();
  }
  
  public void suspend()
    throws DebuggerException
  {
    dbg.suspend();
  }
  
  public void resume()
    throws DebuggerException
  {
    dbg.resume();
  }
  
  public boolean isSuspended()
    throws DebuggerException
  {
    return dbg.isSuspended();
  }
  
  public void setBreakpoint(Address addr)
    throws DebuggerException
  {
    dbg.setBreakpoint(addr);
  }
  
  public void clearBreakpoint(Address addr)
    throws DebuggerException
  {
    dbg.clearBreakpoint(addr);
  }
  
  public boolean isBreakpointSet(Address addr)
    throws DebuggerException
  {
    return dbg.isBreakpointSet(addr);
  }
  
  public DebugEvent debugEventPoll()
    throws DebuggerException
  {
    return dbg.debugEventPoll();
  }
  
  public void debugEventContinue()
    throws DebuggerException
  {
    dbg.debugEventContinue();
  }
}

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

import java.io.PrintStream;
import sun.jvm.hotspot.debugger.cdbg.Sym;
import sun.jvm.hotspot.debugger.cdbg.Type;
import sun.jvm.hotspot.debugger.cdbg.basic.LazyBlockSym;
import sun.jvm.hotspot.debugger.cdbg.basic.LazyType;
import sun.jvm.hotspot.debugger.cdbg.basic.ResolveListener;

final class Win32CDebugInfoBuilder$1
  implements ResolveListener
{
  private final Win32CDebugInfoBuilder this$0;
  
  Win32CDebugInfoBuilder$1(Win32CDebugInfoBuilder paramWin32CDebugInfoBuilder) {}
  
  public void resolveFailed(Type containingType, LazyType failedResolve, String detail)
  {
    System.err.println("WARNING: failed to resolve type of index " + ((Integer)failedResolve.getKey()).intValue() + " in type " + containingType.getName() + " (class " + containingType.getClass().getName() + ") while " + detail);
  }
  
  public void resolveFailed(Type containingType, String staticFieldName)
  {
    System.err.println("WARNING: failed to resolve address of static field \"" + staticFieldName + "\" in type " + containingType.getName());
  }
  
  public void resolveFailed(Sym containingSymbol, LazyType failedResolve, String detail)
  {
    System.err.println("WARNING: failed to resolve type of index " + ((Integer)failedResolve.getKey()).intValue() + " in symbol of type " + containingSymbol.getClass().getName() + " while " + detail);
  }
  
  public void resolveFailed(Sym containingSymbol, LazyBlockSym failedResolve, String detail)
  {
    System.err.println("WARNING: failed to resolve block at offset 0x" + Integer.toHexString(((Integer)failedResolve.getKey()).intValue()) + " in symbol of type " + containingSymbol.getClass().getName() + " while " + detail);
  }
}

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

import java.io.PrintStream;
import java.util.EmptyStackException;
import java.util.HashMap;
import java.util.Map;
import java.util.Stack;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.DebuggerException;
import sun.jvm.hotspot.debugger.cdbg.AccessControl;
import sun.jvm.hotspot.debugger.cdbg.BlockSym;
import sun.jvm.hotspot.debugger.cdbg.CDebugInfoDataBase;
import sun.jvm.hotspot.debugger.cdbg.CVAttributes;
import sun.jvm.hotspot.debugger.cdbg.GlobalSym;
import sun.jvm.hotspot.debugger.cdbg.LocalSym;
import sun.jvm.hotspot.debugger.cdbg.Sym;
import sun.jvm.hotspot.debugger.cdbg.Type;
import sun.jvm.hotspot.debugger.cdbg.basic.BasicArrayType;
import sun.jvm.hotspot.debugger.cdbg.basic.BasicBaseClass;
import sun.jvm.hotspot.debugger.cdbg.basic.BasicBitType;
import sun.jvm.hotspot.debugger.cdbg.basic.BasicBlockSym;
import sun.jvm.hotspot.debugger.cdbg.basic.BasicCDebugInfoDataBase;
import sun.jvm.hotspot.debugger.cdbg.basic.BasicCompoundType;
import sun.jvm.hotspot.debugger.cdbg.basic.BasicDoubleType;
import sun.jvm.hotspot.debugger.cdbg.basic.BasicEnumType;
import sun.jvm.hotspot.debugger.cdbg.basic.BasicField;
import sun.jvm.hotspot.debugger.cdbg.basic.BasicFloatType;
import sun.jvm.hotspot.debugger.cdbg.basic.BasicFunctionSym;
import sun.jvm.hotspot.debugger.cdbg.basic.BasicFunctionType;
import sun.jvm.hotspot.debugger.cdbg.basic.BasicGlobalSym;
import sun.jvm.hotspot.debugger.cdbg.basic.BasicIntType;
import sun.jvm.hotspot.debugger.cdbg.basic.BasicLineNumberInfo;
import sun.jvm.hotspot.debugger.cdbg.basic.BasicLocalSym;
import sun.jvm.hotspot.debugger.cdbg.basic.BasicMemberFunctionType;
import sun.jvm.hotspot.debugger.cdbg.basic.BasicPointerType;
import sun.jvm.hotspot.debugger.cdbg.basic.BasicType;
import sun.jvm.hotspot.debugger.cdbg.basic.BasicVoidType;
import sun.jvm.hotspot.debugger.cdbg.basic.CompoundTypeKind;
import sun.jvm.hotspot.debugger.cdbg.basic.LazyBlockSym;
import sun.jvm.hotspot.debugger.cdbg.basic.LazyType;
import sun.jvm.hotspot.debugger.cdbg.basic.ResolveListener;
import sun.jvm.hotspot.debugger.win32.coff.COFFFile;
import sun.jvm.hotspot.debugger.win32.coff.COFFFileParser;
import sun.jvm.hotspot.debugger.win32.coff.COFFHeader;
import sun.jvm.hotspot.debugger.win32.coff.DebugDirectory;
import sun.jvm.hotspot.debugger.win32.coff.DebugDirectoryEntry;
import sun.jvm.hotspot.debugger.win32.coff.DebugVC50;
import sun.jvm.hotspot.debugger.win32.coff.DebugVC50MemberAttributes;
import sun.jvm.hotspot.debugger.win32.coff.DebugVC50SSAlignSym;
import sun.jvm.hotspot.debugger.win32.coff.DebugVC50SSGlobalSym;
import sun.jvm.hotspot.debugger.win32.coff.DebugVC50SSGlobalTypes;
import sun.jvm.hotspot.debugger.win32.coff.DebugVC50SSSegMap;
import sun.jvm.hotspot.debugger.win32.coff.DebugVC50SSSrcModule;
import sun.jvm.hotspot.debugger.win32.coff.DebugVC50SSSymbolBase;
import sun.jvm.hotspot.debugger.win32.coff.DebugVC50SrcModFileDesc;
import sun.jvm.hotspot.debugger.win32.coff.DebugVC50SrcModLineNumberMap;
import sun.jvm.hotspot.debugger.win32.coff.DebugVC50Subsection;
import sun.jvm.hotspot.debugger.win32.coff.DebugVC50SubsectionDirectory;
import sun.jvm.hotspot.debugger.win32.coff.DebugVC50SubsectionTypes;
import sun.jvm.hotspot.debugger.win32.coff.DebugVC50SymbolIterator;
import sun.jvm.hotspot.debugger.win32.coff.DebugVC50SymbolTypes;
import sun.jvm.hotspot.debugger.win32.coff.DebugVC50TypeEnums;
import sun.jvm.hotspot.debugger.win32.coff.DebugVC50TypeIterator;
import sun.jvm.hotspot.debugger.win32.coff.DebugVC50TypeLeafIndices;
import sun.jvm.hotspot.debugger.win32.coff.OptionalHeader;
import sun.jvm.hotspot.debugger.win32.coff.OptionalHeaderDataDirectories;
import sun.jvm.hotspot.debugger.win32.coff.SectionHeader;
import sun.jvm.hotspot.utilities.Assert;

class Win32CDebugInfoBuilder
  implements DebugVC50SubsectionTypes, DebugVC50TypeLeafIndices, DebugVC50TypeEnums, DebugVC50SymbolTypes, DebugVC50MemberAttributes, CVAttributes, AccessControl
{
  private Win32Debugger dbg;
  private Address base;
  private DebugVC50 vc50;
  private BasicCDebugInfoDataBase db;
  private DebugVC50TypeIterator iter;
  private DebugVC50SymbolIterator symIter;
  private COFFFile file;
  private DebugVC50SSSegMap segMap;
  private Map primIndexToTypeMap;
  private BasicEnumType unnamedEnum;
  private Stack blockStack;
  private int endsToSkip;
  private static final int POINTER_SIZE = 4;
  
  Win32CDebugInfoBuilder(Win32Debugger dbg)
  {
    this.dbg = dbg;
  }
  
  CDebugInfoDataBase buildDataBase(String dllName, Address base)
  {
    this.base = base;
    file = COFFFileParser.getParser().parse(dllName);
    vc50 = getDebugVC50(file);
    if (vc50 == null) {
      return null;
    }
    segMap = getSegMap();
    
    primIndexToTypeMap = new HashMap();
    blockStack = new Stack();
    endsToSkip = 0;
    
    db = new BasicCDebugInfoDataBase();
    db.beginConstruction();
    
    DebugVC50SSGlobalTypes types = getGlobalTypes();
    for (iter = types.getTypeIterator(); !iter.done(); iter.next()) {
      while (!iter.typeStringDone())
      {
        switch (iter.typeStringLeaf())
        {
        case 4097: 
          int idx = iter.getModifierIndex();
          BasicType target = getTypeByIndex(idx);
          short windowsMods = iter.getModifierAttribute();
          short mods = 0;
          if ((windowsMods & 0x1) != 0) {
            mods = (short)(mods | 0x1);
          }
          if ((windowsMods & 0x2) != 0) {
            mods = (short)(mods | 0x2);
          }
          putType(target.getCVVariant(mods));
          break;
        case 4098: 
          int idx = iter.getPointerType();
          BasicType target = getTypeByIndex(idx);
          short windowsMods = iter.getModifierAttribute();
          short mods = 0;
          if ((windowsMods & 0x400) != 0) {
            mods = (short)(mods | 0x1);
          }
          if ((windowsMods & 0x200) != 0) {
            mods = (short)(mods | 0x2);
          }
          BasicPointerType ptrType = new BasicPointerType(4, target);
          if (mods != 0) {
            ptrType = (BasicPointerType)ptrType.getCVVariant(mods);
          }
          putType(ptrType);
          break;
        case 4099: 
          BasicType elemType = getTypeByIndex(iter.getArrayElementType());
          putType(new BasicArrayType(iter.getArrayName(), elemType, iter.getArrayLength()));
          break;
        case 4100: 
        case 4101: 
          CompoundTypeKind kind = iter.typeStringLeaf() == 4100 ? CompoundTypeKind.CLASS : CompoundTypeKind.STRUCT;
          
          BasicCompoundType type = new BasicCompoundType(iter.getClassName(), iter.getClassSize(), kind);
          if ((iter.getClassProperty() & 0x80) == 0)
          {
            DebugVC50TypeIterator fieldIter = iter.getClassFieldListIterator();
            if (Assert.ASSERTS_ENABLED) {
              Assert.that(fieldIter.typeStringLeaf() == 4611, "Expected field list");
            }
            boolean advance = false;
            while (!fieldIter.typeStringDone())
            {
              advance = true;
              switch (fieldIter.typeStringLeaf())
              {
              case 4611: 
                break;
              case 5120: 
                int accessControl = memberAttributeToAccessControl(fieldIter.getBClassAttribute());
                Type baseType = getTypeByIndex(fieldIter.getBClassType());
                
                type.addBaseClass(new BasicBaseClass(accessControl, false, baseType));
                break;
              case 5121: 
                int accessControl = memberAttributeToAccessControl(fieldIter.getVBClassAttribute());
                Type baseType = getTypeByIndex(fieldIter.getVBClassBaseClassType());
                
                type.addBaseClass(new BasicBaseClass(accessControl, true, baseType));
                break;
              case 5122: 
                break;
              case 5124: 
                fieldIter = fieldIter.getIndexIterator();
                advance = false;
                break;
              case 5125: 
                BasicField field = new BasicField(fieldIter.getMemberName(), getTypeByIndex(fieldIter.getMemberType()), memberAttributeToAccessControl(fieldIter.getMemberAttribute()), false);
                
                field.setOffset(fieldIter.getMemberOffset());
                type.addField(field);
                break;
              case 5126: 
                BasicField field = new BasicField(fieldIter.getStaticName(), getTypeByIndex(fieldIter.getStaticType()), memberAttributeToAccessControl(fieldIter.getStaticAttribute()), true);
                
                type.addField(field);
                break;
              case 5127: 
                break;
              case 5131: 
                break;
              case 5128: 
                break;
              case 5133: 
                break;
              case 5129: 
                break;
              case 5130: 
                break;
              case 5132: 
                break;
              case 5134: 
                break;
              case 240: 
              case 241: 
              case 242: 
              case 243: 
              case 244: 
              case 245: 
              case 246: 
              case 247: 
              case 248: 
              case 249: 
              case 250: 
              case 251: 
              case 252: 
              case 253: 
              case 254: 
              case 255: 
                break;
              default: 
                System.err.println("WARNING: unexpected leaf index " + fieldIter.typeStringLeaf() + " in field list for type " + iter.getTypeIndex());
              }
              if (advance) {
                fieldIter.typeStringNext();
              }
            }
          }
          putType(type);
          break;
        case 4102: 
          BasicCompoundType type = new BasicCompoundType(iter.getUnionName(), iter.getUnionSize(), CompoundTypeKind.UNION);
          if ((iter.getClassProperty() & 0x80) == 0)
          {
            DebugVC50TypeIterator fieldIter = iter.getUnionFieldListIterator();
            if (Assert.ASSERTS_ENABLED) {
              Assert.that(fieldIter.typeStringLeaf() == 4611, "Expected field list");
            }
            boolean advance = false;
            while (!fieldIter.typeStringDone())
            {
              advance = true;
              switch (fieldIter.typeStringLeaf())
              {
              case 4611: 
                break;
              case 5120: 
                break;
              case 5121: 
                break;
              case 5122: 
                break;
              case 5124: 
                fieldIter = fieldIter.getIndexIterator();
                advance = false;
                break;
              case 5125: 
                BasicField field = new BasicField(fieldIter.getMemberName(), getTypeByIndex(fieldIter.getMemberType()), memberAttributeToAccessControl(fieldIter.getMemberAttribute()), false);
                
                field.setOffset(fieldIter.getMemberOffset());
                type.addField(field);
                break;
              case 5126: 
                System.err.println("WARNING: I didn't think unions could contain static fields...");
                BasicField field = new BasicField(fieldIter.getStaticName(), getTypeByIndex(fieldIter.getStaticType()), memberAttributeToAccessControl(fieldIter.getStaticAttribute()), true);
                
                type.addField(field);
                break;
              case 5127: 
                break;
              case 5131: 
                break;
              case 5128: 
                break;
              case 5133: 
                break;
              case 5129: 
                break;
              case 5130: 
                break;
              case 5132: 
                break;
              case 5134: 
                break;
              case 240: 
              case 241: 
              case 242: 
              case 243: 
              case 244: 
              case 245: 
              case 246: 
              case 247: 
              case 248: 
              case 249: 
              case 250: 
              case 251: 
              case 252: 
              case 253: 
              case 254: 
              case 255: 
                break;
              default: 
                System.err.println("WARNING: unexpected leaf index " + fieldIter.typeStringLeaf() + " in field list for union of type " + iter.getTypeIndex());
              }
              if (advance) {
                fieldIter.typeStringNext();
              }
            }
          }
          putType(type);
          break;
        case 4103: 
          String name = iter.getEnumName();
          BasicEnumType enumType = null;
          if ((name == null) || (name.equals("")))
          {
            if (unnamedEnum == null) {
              unnamedEnum = new BasicEnumType(null, getTypeByIndex(iter.getEnumType()));
            }
            enumType = unnamedEnum;
          }
          else
          {
            enumType = new BasicEnumType(name, getTypeByIndex(iter.getEnumType()));
          }
          DebugVC50TypeIterator fieldIter = iter.getEnumFieldListIterator();
          if (Assert.ASSERTS_ENABLED) {
            Assert.that(fieldIter.typeStringLeaf() == 4611, "Expected field list");
          }
          boolean advance = false;
          while (!fieldIter.typeStringDone())
          {
            advance = true;
            switch (fieldIter.typeStringLeaf())
            {
            case 4611: 
              break;
            case 1027: 
              String enumName = fieldIter.getEnumerateName();
              long enumVal = fieldIter.getEnumerateValue();
              enumType.addEnum(enumName, enumVal);
              break;
            case 5124: 
              fieldIter = fieldIter.getIndexIterator();
              advance = false;
              break;
            case 240: 
            case 241: 
            case 242: 
            case 243: 
            case 244: 
            case 245: 
            case 246: 
            case 247: 
            case 248: 
            case 249: 
            case 250: 
            case 251: 
            case 252: 
            case 253: 
            case 254: 
            case 255: 
              break;
            default: 
              System.err.println("WARNING: unexpected leaf index " + fieldIter.typeStringLeaf() + " in field list for enum of type " + iter.getTypeIndex());
            }
            if (advance) {
              fieldIter.typeStringNext();
            }
          }
          putType(enumType);
          break;
        case 4104: 
          Type retType = getTypeByIndex(iter.getProcedureReturnType());
          BasicFunctionType func = new BasicFunctionType(null, 4, retType);
          DebugVC50TypeIterator argIter = iter.getProcedureArgumentListIterator();
          if (Assert.ASSERTS_ENABLED) {
            Assert.that(argIter.typeStringLeaf() == 4609, "Expected argument list");
          }
          for (int i = 0; i < argIter.getArgListCount(); i++) {
            func.addArgumentType(getTypeByIndex(argIter.getArgListType(i)));
          }
          putType(func);
          break;
        case 4105: 
          Type retType = getTypeByIndex(iter.getMFunctionReturnType());
          Type container = getTypeByIndex(iter.getMFunctionContainingClass());
          Type thisType = getTypeByIndex(iter.getMFunctionThis());
          long thisAdjust = iter.getMFunctionThisAdjust();
          BasicMemberFunctionType func = new BasicMemberFunctionType(null, 4, retType, container, thisType, thisAdjust);
          
          DebugVC50TypeIterator argIter = iter.getMFunctionArgumentListIterator();
          for (int i = 0; i < argIter.getArgListCount(); i++) {
            func.addArgumentType(getTypeByIndex(argIter.getArgListType(i)));
          }
          putType(func);
          break;
        case 10: 
          break;
        case 4107: 
          System.err.println("FIXME: don't know what to do with LF_BARRAY leaves (convert to pointers?"); break;
        case 14: 
          break;
        case 15: 
          break;
        case 4108: 
          System.err.println("FIXME: don't know what to do with LF_DIMARRAY leaves yet"); break;
        case 4109: 
          break;
        case 4110: 
          break;
        case 20: 
          break;
        case 4111: 
          break;
        case 22: 
          break;
        case 4608: 
          break;
        case 4609: 
          skipTypeRecord(); break;
        case 4610: 
          System.err.println("FIXME: handle default arguments (dereference the type)"); break;
        case 4611: 
          skipTypeRecord(); break;
        case 4612: 
          break;
        case 4613: 
          Type underlyingType = getTypeByIndex(iter.getBitfieldFieldType());
          BasicBitType bit = new BasicBitType(underlyingType, iter.getBitfieldLength() & 0xFF, iter.getBitfieldPosition() & 0xFF);
          
          putType(bit);
          break;
        case 4614: 
          break;
        case 4615: 
        case 4616: 
        case 4617: 
        case 4618: 
          break;
        case 524: 
          break;
        case 240: 
        case 241: 
        case 242: 
        case 243: 
        case 244: 
        case 245: 
        case 246: 
        case 247: 
        case 248: 
        case 249: 
        case 250: 
        case 251: 
        case 252: 
        case 253: 
        case 254: 
        case 255: 
          break;
        default: 
          System.err.println("Unexpected leaf index " + iter.typeStringLeaf() + " at offset 0x" + Integer.toHexString(iter.typeStringOffset()));
        }
        if (!iter.typeStringDone()) {
          iter.typeStringNext();
        }
      }
    }
    DebugVC50SubsectionDirectory dir = vc50.getSubsectionDirectory();
    int moduleNumber = 0;
    for (int i = 0; i < dir.getNumEntries(); i++)
    {
      DebugVC50Subsection ss = dir.getSubsection(i);
      int ssType = ss.getSubsectionType();
      boolean process = false;
      if ((ssType == 297) || (ssType == 298) || (ssType == 308))
      {
        DebugVC50SSSymbolBase syms = (DebugVC50SSSymbolBase)ss;
        symIter = syms.getSymbolIterator();
        process = true;
      }
      if (ssType == 293)
      {
        DebugVC50SSAlignSym syms = (DebugVC50SSAlignSym)ss;
        symIter = syms.getSymbolIterator();
        process = true;
      }
      if (process) {
        for (; !symIter.done(); symIter.next()) {
          switch (symIter.getType())
          {
          case 1: 
            break;
          case 5: 
            break;
          case 6: 
            try
            {
              if (endsToSkip == 0) {
                blockStack.pop();
              } else {
                endsToSkip -= 1;
              }
            }
            catch (EmptyStackException e)
            {
              System.err.println("WARNING: mismatched block begins/ends in debug information");
            }
          case 7: 
            break;
          case 8: 
            break;
          case 9: 
            break;
          case 10: 
            break;
          case 11: 
            break;
          case 12: 
            break;
          case 13: 
            break;
          case 14: 
            break;
          case 4097: 
            break;
          case 4098: 
            break;
          case 4099: 
            break;
          case 4100: 
            break;
          case 4101: 
            break;
          case 4102: 
            LocalSym sym = new BasicLocalSym(symIter.getBPRelName(), getTypeByIndex(symIter.getBPRelType()), symIter.getBPRelOffset());
            
            addLocalToCurBlock(sym);
            break;
          case 4103: 
          case 4104: 
            boolean isModuleLocal = symIter.getType() == 4103;
            
            GlobalSym sym = new BasicGlobalSym(symIter.getLGDataName(), getTypeByIndex(symIter.getLGDataType()), newAddress(symIter.getLGDataOffset(), symIter.getLGDataSegment()), isModuleLocal);
            
            addGlobalSym(sym);
            break;
          case 4105: 
            break;
          case 4106: 
          case 4107: 
            BasicFunctionSym sym = new BasicFunctionSym(newLazyBlockSym(symIter.getLGProcParentOffset()), symIter.getLGProcLength(), newAddress(symIter.getLGProcOffset(), symIter.getLGProcSegment()), symIter.getLGProcName(), getTypeByIndex(symIter.getLGProcType()), symIter.getType() == 4106);
            
            addBlock(sym);
            break;
          case 518: 
            skipEnd();
            break;
          case 519: 
            BasicBlockSym sym = new BasicBlockSym(newLazyBlockSym(symIter.getBlockParentOffset()), symIter.getBlockLength(), newAddress(symIter.getBlockOffset(), symIter.getBlockSegment()), symIter.getBlockName());
            
            addBlock(sym);
            break;
          case 520: 
            break;
          case 521: 
            break;
          case 522: 
            break;
          case 4108: 
            break;
          case 4109: 
            break;
          case 4110: 
            break;
          case 4111: 
            break;
          case 1024: 
            break;
          case 1025: 
            break;
          case 1026: 
            break;
          default: 
            if ((symIter.getType() != 0) && (symIter.getType() != 4115)) {
              System.err.println("  NOTE: Unexpected symbol of type " + symIter.getType() + " at offset 0x" + Integer.toHexString(symIter.getOffset()));
            }
            break;
          }
        }
      }
    }
    for (int i = 0; i < dir.getNumEntries(); i++)
    {
      DebugVC50Subsection ss = dir.getSubsection(i);
      if (ss.getSubsectionType() == 295)
      {
        DebugVC50SSSrcModule srcMod = (DebugVC50SSSrcModule)ss;
        for (int sf = 0; sf < srcMod.getNumSourceFiles(); sf++)
        {
          DebugVC50SrcModFileDesc desc = srcMod.getSourceFileDesc(sf);
          
          String name = desc.getSourceFileName().intern();
          for (int cs = 0; cs < desc.getNumCodeSegments(); cs++)
          {
            DebugVC50SrcModLineNumberMap map = desc.getLineNumberMap(cs);
            SectionHeader seg = file.getHeader().getSectionHeader(map.getSegment());
            for (int lp = 0; lp < map.getNumSourceLinePairs(); lp++)
            {
              Address startPC = base.addOffsetTo(seg.getVirtualAddress() + map.getCodeOffset(lp));
              
              Address endPC = base.addOffsetTo(seg.getSize());
              db.addLineNumberInfo(new BasicLineNumberInfo(name, map.getLineNumber(lp), startPC, endPC));
            }
          }
        }
      }
    }
    db.resolve(new ResolveListener()
    {
      public void resolveFailed(Type containingType, LazyType failedResolve, String detail)
      {
        System.err.println("WARNING: failed to resolve type of index " + ((Integer)failedResolve.getKey()).intValue() + " in type " + containingType.getName() + " (class " + containingType.getClass().getName() + ") while " + detail);
      }
      
      public void resolveFailed(Type containingType, String staticFieldName)
      {
        System.err.println("WARNING: failed to resolve address of static field \"" + staticFieldName + "\" in type " + containingType.getName());
      }
      
      public void resolveFailed(Sym containingSymbol, LazyType failedResolve, String detail)
      {
        System.err.println("WARNING: failed to resolve type of index " + ((Integer)failedResolve.getKey()).intValue() + " in symbol of type " + containingSymbol.getClass().getName() + " while " + detail);
      }
      
      public void resolveFailed(Sym containingSymbol, LazyBlockSym failedResolve, String detail)
      {
        System.err.println("WARNING: failed to resolve block at offset 0x" + Integer.toHexString(((Integer)failedResolve.getKey()).intValue()) + " in symbol of type " + containingSymbol.getClass().getName() + " while " + detail);
      }
    });
    db.endConstruction();
    
    return db;
  }
  
  private static DebugVC50 getDebugVC50(COFFFile file)
  {
    COFFHeader header = file.getHeader();
    OptionalHeader opt = header.getOptionalHeader();
    if (opt == null) {
      return null;
    }
    OptionalHeaderDataDirectories dd = opt.getDataDirectories();
    if (dd == null) {
      return null;
    }
    DebugDirectory debug = dd.getDebugDirectory();
    if (debug == null) {
      return null;
    }
    for (int i = 0; i < debug.getNumEntries(); i++)
    {
      DebugDirectoryEntry entry = debug.getEntry(i);
      if (entry.getType() == 2) {
        return entry.getDebugVC50();
      }
    }
    return null;
  }
  
  private DebugVC50SSSegMap getSegMap()
  {
    return (DebugVC50SSSegMap)findSubsection((short)301);
  }
  
  private DebugVC50SSGlobalTypes getGlobalTypes()
  {
    return (DebugVC50SSGlobalTypes)findSubsection((short)299);
  }
  
  private DebugVC50SSGlobalSym getGlobalSymbols()
  {
    return (DebugVC50SSGlobalSym)findSubsection((short)297);
  }
  
  private DebugVC50Subsection findSubsection(short ssType)
  {
    DebugVC50SubsectionDirectory dir = vc50.getSubsectionDirectory();
    for (int i = 0; i < dir.getNumEntries(); i++)
    {
      DebugVC50Subsection ss = dir.getSubsection(i);
      if (ss.getSubsectionType() == ssType) {
        return ss;
      }
    }
    throw new DebuggerException("Unable to find subsection of type " + ssType);
  }
  
  private void putType(Type t)
  {
    db.addType(new Integer(iter.getTypeIndex()), t);
  }
  
  private Address newAddress(int offset, short segment)
  {
    int seg = segment & 0xFFFF;
    
    SectionHeader section = file.getHeader().getSectionHeader(seg);
    
    return base.addOffsetTo(section.getVirtualAddress() + offset);
  }
  
  private BasicType getTypeByIndex(int intIndex)
  {
    Integer index = new Integer(intIndex);
    if (intIndex <= 4095)
    {
      BasicType type = (BasicType)primIndexToTypeMap.get(index);
      if (type != null) {
        return type;
      }
      int primMode = intIndex & 0x700;
      if (primMode == 0)
      {
        int primType = intIndex & 0x70;
        switch (primType)
        {
        case 16: 
        case 32: 
          boolean unsigned = primType == 32;
          int size = 0;
          String name = null;
          switch (intIndex & 0x7)
          {
          case 0: 
            size = 1;name = "char"; break;
          case 1: 
            size = 2;name = "short"; break;
          case 2: 
            size = 4;name = "int"; break;
          case 3: 
            size = 8;name = "__int64"; break;
          default: 
            throw new DebuggerException("Illegal size of integer type " + intIndex);
          }
          type = new BasicIntType(name, size, unsigned);
          break;
        case 48: 
          int size = 0;
          switch (intIndex & 0x7)
          {
          case 0: 
            size = 1; break;
          case 1: 
            size = 2; break;
          case 2: 
            size = 4; break;
          case 3: 
            size = 8; break;
          default: 
            throw new DebuggerException("Illegal size of boolean type " + intIndex);
          }
          type = new BasicIntType("bool", size, false);
          break;
        case 64: 
          switch (intIndex & 0x7)
          {
          case 0: 
            type = new BasicFloatType("float", 4);
            break;
          case 1: 
            type = new BasicDoubleType("double", 8);
            break;
          default: 
            throw new DebuggerException("Unsupported floating-point size in type " + intIndex);
          }
          break;
        case 112: 
          switch (intIndex & 0x7)
          {
          case 0: 
            type = new BasicIntType("char", 1, false); break;
          case 1: 
            type = new BasicIntType("wchar", 2, false); break;
          case 2: 
            type = new BasicIntType("short", 2, false); break;
          case 3: 
            type = new BasicIntType("short", 2, true); break;
          case 4: 
            type = new BasicIntType("int", 4, false); break;
          case 5: 
            type = new BasicIntType("int", 4, true); break;
          case 6: 
            type = new BasicIntType("__int64", 8, false); break;
          case 7: 
            type = new BasicIntType("__int64", 8, true); break;
          default: 
            throw new DebuggerException("Illegal REALLY_INT size in type " + intIndex);
          }
          break;
        case 0: 
          switch (intIndex & 0x7)
          {
          case 0: 
          case 3: 
            type = new BasicVoidType(); break;
          default: 
            throw new DebuggerException("Don't know how to handle reserved special type " + intIndex);
          }
          break;
        default: 
          throw new DebuggerException("Don't know how to handle reserved type " + intIndex);
        }
      }
      else
      {
        Type targetType = getTypeByIndex(intIndex & 0xF8FF);
        
        type = new BasicPointerType(4, targetType);
      }
      if (Assert.ASSERTS_ENABLED) {
        Assert.that(type != null, "Got null Type for primitive type " + intIndex);
      }
      primIndexToTypeMap.put(index, type);
      return type;
    }
    return new LazyType(index);
  }
  
  private void addBlock(BlockSym block)
  {
    db.addBlock(new Integer(symIter.getOffset()), block);
    blockStack.push(block);
  }
  
  private void skipEnd()
  {
    endsToSkip += 1;
  }
  
  private BlockSym newLazyBlockSym(int offset)
  {
    if (offset == 0) {
      return null;
    }
    return new LazyBlockSym(new Integer(offset));
  }
  
  private int memberAttributeToAccessControl(short memberAttribute)
  {
    int acc = memberAttribute & 0x3;
    switch (acc)
    {
    case 0: 
      return 0;
    case 1: 
      return 1;
    case 2: 
      return 2;
    case 3: 
      return 3;
    }
    throw new RuntimeException("Should not reach here");
  }
  
  private void addLocalToCurBlock(LocalSym local)
  {
    ((BasicBlockSym)blockStack.peek()).addLocal(local);
  }
  
  private void addGlobalSym(GlobalSym sym)
  {
    db.addGlobalSym(sym);
  }
  
  private void skipTypeRecord()
  {
    while (!iter.typeStringDone()) {
      iter.typeStringNext();
    }
  }
}

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

import java.util.List;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.DebuggerException;
import sun.jvm.hotspot.debugger.JVMDebugger;
import sun.jvm.hotspot.debugger.UnmappedAddressException;
import sun.jvm.hotspot.debugger.cdbg.DebugEvent;

public abstract interface Win32Debugger
  extends JVMDebugger
{
  public abstract String addressValueToString(long paramLong)
    throws DebuggerException;
  
  public abstract boolean readJBoolean(long paramLong)
    throws DebuggerException;
  
  public abstract byte readJByte(long paramLong)
    throws DebuggerException;
  
  public abstract char readJChar(long paramLong)
    throws DebuggerException;
  
  public abstract double readJDouble(long paramLong)
    throws DebuggerException;
  
  public abstract float readJFloat(long paramLong)
    throws DebuggerException;
  
  public abstract int readJInt(long paramLong)
    throws DebuggerException;
  
  public abstract long readJLong(long paramLong)
    throws DebuggerException;
  
  public abstract short readJShort(long paramLong)
    throws DebuggerException;
  
  public abstract long readCInteger(long paramLong1, long paramLong2, boolean paramBoolean)
    throws De
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