sa-jdi

tOffset();
          if (offs == 0) {
            return null;
          }
          return new DebugVC50SymbolIteratorImpl(COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this, base, size, base + offs);
        }
        
        public int getThunkNextOffset()
        {
          symSeek(8);
          int offs = readInt();
          if (offs == 0) {
            return 0;
          }
          return base + offs;
        }
        
        public int getThunkOffset()
        {
          symSeek(12);
          return readInt();
        }
        
        public short getThunkSegment()
        {
          symSeek(16);
          return readShort();
        }
        
        public short getThunkLength()
        {
          symSeek(18);
          return readShort();
        }
        
        public byte getThunkType()
        {
          symSeek(20);
          return readByte();
        }
        
        public String getThunkName()
        {
          return readLengthPrefixedStringAt(21);
        }
        
        public short getThunkAdjustorThisDelta()
        {
          symSeek(21 + lengthPrefixedStringLengthAt(21));
          return readShort();
        }
        
        public String getThunkAdjustorTargetName()
        {
          return readLengthPrefixedStringAt(23 + lengthPrefixedStringLengthAt(21));
        }
        
        public short getThunkVCallDisplacement()
        {
          symSeek(21 + lengthPrefixedStringLengthAt(21));
          return readShort();
        }
        
        public int getThunkPCodeOffset()
        {
          symSeek(21 + lengthPrefixedStringLengthAt(21));
          return readInt();
        }
        
        public short getThunkPCodeSegment()
        {
          symSeek(25 + lengthPrefixedStringLengthAt(21));
          return readShort();
        }
        
        public DebugVC50SymbolIterator getBlockParent()
        {
          int offs = getBlockParentOffset();
          if (offs == 0) {
            return null;
          }
          return new DebugVC50SymbolIteratorImpl(COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this, base, size, offs);
        }
        
        public int getBlockParentOffset()
        {
          symSeek(0);
          int offs = readInt();
          if (offs == 0) {
            return 0;
          }
          return base + offs;
        }
        
        public DebugVC50SymbolIterator getBlockEnd()
        {
          symSeek(4);
          int offs = readInt();
          return new DebugVC50SymbolIteratorImpl(COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this, base, size, offs);
        }
        
        public int getBlockEndOffset()
        {
          symSeek(4);
          int offs = readInt();
          if (Assert.ASSERTS_ENABLED) {
            Assert.that(offs != 0, "should not have null end offset for block symbols");
          }
          return base + offs;
        }
        
        public int getBlockLength()
        {
          symSeek(8);
          return readInt();
        }
        
        public int getBlockOffset()
        {
          symSeek(12);
          return readInt();
        }
        
        public short getBlockSegment()
        {
          symSeek(16);
          return readShort();
        }
        
        public String getBlockName()
        {
          return readLengthPrefixedStringAt(18);
        }
        
        public int getLabelOffset()
        {
          symSeek(0);
          return readInt();
        }
        
        public short getLabelSegment()
        {
          symSeek(4);
          return readShort();
        }
        
        public byte getLabelFlags()
        {
          symSeek(6);
          return readByte();
        }
        
        public String getLabelName()
        {
          return readLengthPrefixedStringAt(7);
        }
        
        public int getChangeOffset()
        {
          symSeek(0);
          return readInt();
        }
        
        public short getChangeSegment()
        {
          symSeek(4);
          return readShort();
        }
        
        public short getChangeModel()
        {
          symSeek(6);
          return readShort();
        }
        
        public int getVTableRoot()
        {
          symSeek(0);
          return readInt();
        }
        
        public int getVTablePath()
        {
          symSeek(4);
          return readInt();
        }
        
        public int getVTableOffset()
        {
          symSeek(8);
          return readInt();
        }
        
        public short getVTableSegment()
        {
          symSeek(12);
          return readShort();
        }
        
        public int getRegRelOffset()
        {
          symSeek(0);
          return readInt();
        }
        
        public int getRegRelType()
        {
          symSeek(4);
          return readInt();
        }
        
        public short getRegRelRegister()
        {
          symSeek(8);
          return readShort();
        }
        
        public String getRegRelName()
        {
          return readLengthPrefixedStringAt(10);
        }
        
        public int getLThreadType()
        {
          symSeek(0);
          return readInt();
        }
        
        public int getLThreadOffset()
        {
          symSeek(4);
          return readInt();
        }
        
        public short getLThreadSegment()
        {
          symSeek(8);
          return readShort();
        }
        
        public String getLThreadName()
        {
          return readLengthPrefixedStringAt(10);
        }
        
        private void symSeek(int offsetInSym)
        {
          seek(pos + 4 + offsetInSym);
        }
        
        private int numericLeafLengthAt(int offsetInSym)
        {
          return COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this.numericLeafLengthAt(pos + 4 + offsetInSym);
        }
        
        private int readIntNumericLeafAt(int offsetInSym)
        {
          return COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this.readIntNumericLeafAt(pos + 4 + offsetInSym);
        }
        
        private long readLongNumericLeafAt(int offsetInSym)
        {
          return COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this.readLongNumericLeafAt(pos + 4 + offsetInSym);
        }
        
        private float readFloatNumericLeafAt(int offsetInSym)
        {
          return COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this.readFloatNumericLeafAt(pos + 4 + offsetInSym);
        }
        
        private double readDoubleNumericLeafAt(int offsetInSym)
        {
          return COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this.readDoubleNumericLeafAt(pos + 4 + offsetInSym);
        }
        
        private int lengthPrefixedStringLengthAt(int offsetInSym)
        {
          return COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this.lengthPrefixedStringLengthAt(pos + 4 + offsetInSym);
        }
        
        private String readLengthPrefixedStringAt(int offsetInSym)
        {
          return COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this.readLengthPrefixedStringAt(pos + 4 + offsetInSym);
        }
      }
      
      class DebugVC50TypeIteratorImpl
        implements DebugVC50TypeIterator, DebugVC50TypeLeafIndices, DebugVC50MemberAttributes, DebugVC50TypeEnums
      {
        private DebugVC50SSGlobalTypes parent;
        private int base;
        private int numTypes;
        private int typeIndex;
        private int typeRecordOffset;
        private int typeStringOffset;
        private int typeRecordSize;
        private int typeStringLeaf;
        
        DebugVC50TypeIteratorImpl(DebugVC50SSGlobalTypes parent, int base, int numTypes)
        {
          this(parent, base, numTypes, 0, base);
        }
        
        private DebugVC50TypeIteratorImpl(DebugVC50SSGlobalTypes parent, int base, int numTypes, int curType, int offset)
        {
          this.parent = parent;
          this.base = base;
          this.numTypes = numTypes;
          typeIndex = curType;
          if (!done())
          {
            typeRecordOffset = offset;
            loadTypeRecord();
          }
        }
        
        public boolean done()
        {
          return typeIndex == numTypes;
        }
        
        public void next()
          throws NoSuchElementException
        {
          if (done()) {
            throw new NoSuchElementException();
          }
          typeIndex += 1;
          if (!done())
          {
            typeRecordOffset = parent.getTypeOffset(typeIndex);
            loadTypeRecord();
          }
        }
        
        public short getLength()
        {
          return (short)typeRecordSize;
        }
        
        public int getTypeIndex()
        {
          return COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this.biasTypeIndex(typeIndex);
        }
        
        public int getNumTypes()
        {
          return numTypes;
        }
        
        public boolean typeStringDone()
        {
          return typeStringOffset - typeRecordOffset - 2 >= typeRecordSize;
        }
        
        public void typeStringNext()
          throws NoSuchElementException
        {
          if (typeStringDone()) {
            throw new NoSuchElementException();
          }
          typeStringOffset += typeStringLength();
          loadTypeString();
        }
        
        public int typeStringLeaf()
        {
          return typeStringLeaf;
        }
        
        public int typeStringOffset()
        {
          return typeStringOffset;
        }
        
        public int getModifierIndex()
        {
          typeSeek(2);
          return readInt();
        }
        
        public short getModifierAttribute()
        {
          typeSeek(6);
          return readShort();
        }
        
        public int getPointerType()
        {
          typeSeek(2);
          return readInt();
        }
        
        public int getPointerAttributes()
        {
          typeSeek(6);
          return readInt();
        }
        
        public int getPointerBasedOnTypeIndex()
        {
          typeSeek(10);
          return readInt();
        }
        
        public String getPointerBasedOnTypeName()
        {
          return readLengthPrefixedStringAt(14);
        }
        
        public int getPointerToMemberClass()
        {
          typeSeek(10);
          return readInt();
        }
        
        public short getPointerToMemberFormat()
        {
          typeSeek(14);
          return readShort();
        }
        
        public int getArrayElementType()
        {
          typeSeek(2);
          return readInt();
        }
        
        public int getArrayIndexType()
        {
          typeSeek(6);
          return readInt();
        }
        
        public int getArrayLength()
          throws DebugVC50WrongNumericTypeException
        {
          return readIntNumericLeafAt(10);
        }
        
        public String getArrayName()
        {
          return readLengthPrefixedStringAt(10 + numericLeafLengthAt(10));
        }
        
        public short getClassCount()
        {
          typeSeek(2);
          return readShort();
        }
        
        public short getClassProperty()
        {
          typeSeek(4);
          return readShort();
        }
        
        public int getClassFieldList()
        {
          typeSeek(6);
          return readInt();
        }
        
        public DebugVC50TypeIterator getClassFieldListIterator()
        {
          int index = COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this.unbiasTypeIndex(getClassFieldList());
          int offset = parent.getTypeOffset(index);
          return new DebugVC50TypeIteratorImpl(COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this, parent, base, numTypes, index, offset);
        }
        
        public int getClassDerivationList()
        {
          typeSeek(10);
          return readInt();
        }
        
        public int getClassVShape()
        {
          typeSeek(14);
          return readInt();
        }
        
        public int getClassSize()
          throws DebugVC50WrongNumericTypeException
        {
          return readIntNumericLeafAt(18);
        }
        
        public String getClassName()
        {
          return readLengthPrefixedStringAt(18 + numericLeafLengthAt(18));
        }
        
        public short getUnionCount()
        {
          typeSeek(2);
          return readShort();
        }
        
        public short getUnionProperty()
        {
          typeSeek(4);
          return readShort();
        }
        
        public int getUnionFieldList()
        {
          typeSeek(6);
          return readInt();
        }
        
        public DebugVC50TypeIterator getUnionFieldListIterator()
        {
          int index = COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this.unbiasTypeIndex(getUnionFieldList());
          int offset = parent.getTypeOffset(index);
          return new DebugVC50TypeIteratorImpl(COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this, parent, base, numTypes, index, offset);
        }
        
        public int getUnionSize()
          throws DebugVC50WrongNumericTypeException
        {
          return readIntNumericLeafAt(10);
        }
        
        public String getUnionName()
        {
          return readLengthPrefixedStringAt(10 + numericLeafLengthAt(10));
        }
        
        public short getEnumCount()
        {
          typeSeek(2);
          return readShort();
        }
        
        public short getEnumProperty()
        {
          typeSeek(4);
          return readShort();
        }
        
        public int getEnumType()
        {
          typeSeek(6);
          return readInt();
        }
        
        public int getEnumFieldList()
        {
          typeSeek(10);
          return readInt();
        }
        
        public DebugVC50TypeIterator getEnumFieldListIterator()
        {
          int index = COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this.unbiasTypeIndex(getEnumFieldList());
          int offset = parent.getTypeOffset(index);
          return new DebugVC50TypeIteratorImpl(COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this, parent, base, numTypes, index, offset);
        }
        
        public String getEnumName()
        {
          return readLengthPrefixedStringAt(14);
        }
        
        public int getProcedureReturnType()
        {
          typeSeek(2);
          return readInt();
        }
        
        public byte getProcedureCallingConvention()
        {
          typeSeek(6);
          return readByte();
        }
        
        public short getProcedureNumberOfParameters()
        {
          typeSeek(8);
          return readShort();
        }
        
        public int getProcedureArgumentList()
        {
          typeSeek(10);
          return readInt();
        }
        
        public DebugVC50TypeIterator getProcedureArgumentListIterator()
        {
          int index = COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this.unbiasTypeIndex(getProcedureArgumentList());
          int offset = parent.getTypeOffset(index);
          return new DebugVC50TypeIteratorImpl(COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this, parent, base, numTypes, index, offset);
        }
        
        public int getMFunctionReturnType()
        {
          typeSeek(2);
          return readInt();
        }
        
        public int getMFunctionContainingClass()
        {
          typeSeek(6);
          return readInt();
        }
        
        public int getMFunctionThis()
        {
          typeSeek(10);
          return readInt();
        }
        
        public byte getMFunctionCallingConvention()
        {
          typeSeek(14);
          return readByte();
        }
        
        public short getMFunctionNumberOfParameters()
        {
          typeSeek(16);
          return readShort();
        }
        
        public int getMFunctionArgumentList()
        {
          typeSeek(18);
          return readInt();
        }
        
        public DebugVC50TypeIterator getMFunctionArgumentListIterator()
        {
          int index = COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this.unbiasTypeIndex(getMFunctionArgumentList());
          int offset = parent.getTypeOffset(index);
          return new DebugVC50TypeIteratorImpl(COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this, parent, base, numTypes, index, offset);
        }
        
        public int getMFunctionThisAdjust()
        {
          typeSeek(22);
          return readInt();
        }
        
        public short getVTShapeCount()
        {
          typeSeek(2);
          return readShort();
        }
        
        public int getVTShapeDescriptor(int i)
        {
          typeSeek(4 + i / 2);
          int val = readByte() & 0xFF;
          if (i % 2 != 0) {
            val >>= 4;
          }
          return val;
        }
        
        public int getBasicArrayType()
        {
          typeSeek(2);
          return readInt();
        }
        
        public short getLabelAddressMode()
        {
          typeSeek(2);
          return readShort();
        }
        
        public int getDimArrayType()
        {
          typeSeek(2);
          return readInt();
        }
        
        public int getDimArrayDimInfo()
        {
          typeSeek(6);
          return readInt();
        }
        
        public String getDimArrayName()
        {
          return readLengthPrefixedStringAt(10);
        }
        
        public int getVFTPathCount()
        {
          typeSeek(2);
          return readInt();
        }
        
        public int getVFTPathBase(int i)
        {
          typeSeek(6 + 4 * i);
          return readInt();
        }
        
        public int getSkipIndex()
        {
          typeSeek(2);
          return readInt();
        }
        
        public int getArgListCount()
        {
          typeSeek(2);
          return readInt();
        }
        
        public int getArgListType(int i)
        {
          typeSeek(6 + 4 * i);
          return readInt();
        }
        
        public int getDefaultArgType()
        {
          typeSeek(2);
          return readInt();
        }
        
        public String getDefaultArgExpression()
        {
          return readLengthPrefixedStringAt(6);
        }
        
        public int getDerivedCount()
        {
          typeSeek(2);
          return readInt();
        }
        
        public int getDerivedType(int i)
        {
          typeSeek(6);
          return readInt();
        }
        
        public int getBitfieldFieldType()
        {
          typeSeek(2);
          return readInt();
        }
        
        public byte getBitfieldLength()
        {
          typeSeek(6);
          return readByte();
        }
        
        public byte getBitfieldPosition()
        {
          typeSeek(7);
          return readByte();
        }
        
        public short getMListAttribute()
        {
          typeSeek(2);
          return readShort();
        }
        
        public int getMListLength()
        {
          return (getLength() - 6 - (isMListIntroducingVirtual() ? 4 : 0)) / 4;
        }
        
        public int getMListType(int i)
        {
          typeSeek(6 + 4 * i);
          return readInt();
        }
        
        public boolean isMListIntroducingVirtual()
        {
          return isIntroducingVirtual(getMListAttribute());
        }
        
        public int getMListVtabOffset()
        {
          typeSeek(6 + 4 * getMListLength());
          return readInt();
        }
        
        public DebugVC50SymbolIterator getRefSym()
        {
          typeSeek(2);
          int len = readShort() & 0xFFFF;
          return new COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SymbolIteratorImpl(COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this, typeStringOffset + 2, len);
        }
        
        public short getBClassAttribute()
        {
          typeSeek(2);
          return readShort();
        }
        
        public int getBClassType()
        {
          typeSeek(4);
          return readInt();
        }
        
        public int getBClassOffset()
          throws DebugVC50WrongNumericTypeException
        {
          return readIntNumericLeafAt(8);
        }
        
        public short getVBClassAttribute()
        {
          typeSeek(2);
          return readShort();
        }
        
        public int getVBClassBaseClassType()
        {
          typeSeek(4);
          return readInt();
        }
        
        public int getVBClassVirtualBaseClassType()
        {
          typeSeek(8);
          return readInt();
        }
        
        public int getVBClassVBPOff()
          throws DebugVC50WrongNumericTypeException
        {
          return readIntNumericLeafAt(12);
        }
        
        public int getVBClassVBOff()
          throws DebugVC50WrongNumericTypeException
        {
          return readIntNumericLeafAt(12 + numericLeafLengthAt(12));
        }
        
        public short getIVBClassAttribute()
        {
          typeSeek(2);
          return readShort();
        }
        
        public int getIVBClassBType()
        {
          typeSeek(4);
          return readInt();
        }
        
        public int getIVBClassVBPType()
        {
          typeSeek(8);
          return readInt();
        }
        
        public int getIVBClassVBPOff()
          throws DebugVC50WrongNumericTypeException
        {
          return readIntNumericLeafAt(12);
        }
        
        public int getIVBClassVBOff()
          throws DebugVC50WrongNumericTypeException
        {
          return readIntNumericLeafAt(12 + numericLeafLengthAt(12));
        }
        
        public short getEnumerateAttribute()
        {
          typeSeek(2);
          return readShort();
        }
        
        public long getEnumerateValue()
        {
          return readIntNumericLeafAt(4);
        }
        
        public String getEnumerateName()
        {
          return readLengthPrefixedStringAt(4 + numericLeafLengthAt(4));
        }
        
        public int getFriendFcnType()
        {
          typeSeek(4);
          return readInt();
        }
        
        public String getFriendFcnName()
        {
          return readLengthPrefixedStringAt(8);
        }
        
        public int getIndexValue()
        {
          typeSeek(4);
          return readInt();
        }
        
        public DebugVC50TypeIterator getIndexIterator()
        {
          int index = COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this.unbiasTypeIndex(getIndexValue());
          int offset = parent.getTypeOffset(index);
          return new DebugVC50TypeIteratorImpl(COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this, parent, base, numTypes, index, offset);
        }
        
        public short getMemberAttribute()
        {
          typeSeek(2);
          return readShort();
        }
        
        public int getMemberType()
        {
          typeSeek(4);
          return readInt();
        }
        
        public int getMemberOffset()
          throws DebugVC50WrongNumericTypeException
        {
          return readIntNumericLeafAt(8);
        }
        
        public String getMemberName()
        {
          return readLengthPrefixedStringAt(8 + numericLeafLengthAt(8));
        }
        
        public short getStaticAttribute()
        {
          typeSeek(2);
          return readShort();
        }
        
        public int getStaticType()
        {
          typeSeek(4);
          return readInt();
        }
        
        public String getStaticName()
        {
          return readLengthPrefixedStringAt(8);
        }
        
        public short getMethodCount()
        {
          typeSeek(2);
          return readShort();
        }
        
        public int getMethodList()
        {
          typeSeek(4);
          return readInt();
        }
        
        public String getMethodName()
        {
          return readLengthPrefixedStringAt(8);
        }
        
        public int getNestedType()
        {
          typeSeek(4);
          return readInt();
        }
        
        public String getNestedName()
        {
          return readLengthPrefixedStringAt(8);
        }
        
        public int getVFuncTabType()
        {
          typeSeek(4);
          return readInt();
        }
        
        public int getFriendClsType()
        {
          typeSeek(4);
          return readInt();
        }
        
        public short getOneMethodAttribute()
        {
          typeSeek(2);
          return readShort();
        }
        
        public int getOneMethodType()
        {
          typeSeek(4);
          return readInt();
        }
        
        public boolean isOneMethodIntroducingVirtual()
        {
          return isIntroducingVirtual(getOneMethodAttribute());
        }
        
        public int getOneMethodVBaseOff()
        {
          typeSeek(8);
          return readInt();
        }
        
        public String getOneMethodName()
        {
          int baseLen = 8 + (isOneMethodIntroducingVirtual() ? 4 : 0);
          return readLengthPrefixedStringAt(baseLen);
        }
        
        public int getVFuncOffType()
        {
          typeSeek(4);
          return readInt();
        }
        
        public int getVFuncOffOffset()
        {
          typeSeek(8);
          return readInt();
        }
        
        public short getNestedExAttribute()
        {
          typeSeek(2);
          return readShort();
        }
        
        public int getNestedExType()
        {
          typeSeek(4);
          return readInt();
        }
        
        public String getNestedExName()
        {
          return readLengthPrefixedStringAt(8);
        }
        
        public short getMemberModifyAttribute()
        {
          typeSeek(2);
          return readShort();
        }
        
        public int getMemberModifyType()
        {
          typeSeek(4);
          return readInt();
        }
        
        public String getMemberModifyName()
        {
          return readLengthPrefixedStringAt(8);
        }
        
        public short getNumericTypeAt(int byteOffset)
        {
          typeSeek(byteOffset);
          return readShort();
        }
        
        public int getNumericLengthAt(int byteOffset)
          throws DebugVC50WrongNumericTypeException
        {
          return numericLeafLengthAt(byteOffset);
        }
        
        public int getNumericIntAt(int byteOffset)
          throws DebugVC50WrongNumericTypeException
        {
          return readIntNumericLeafAt(byteOffset);
        }
        
        public long getNumericLongAt(int byteOffset)
          throws DebugVC50WrongNumericTypeException
        {
          throw new RuntimeException("Unimplemented");
        }
        
        public float getNumericFloatAt(int byteOffset)
          throws DebugVC50WrongNumericTypeException
        {
          throw new RuntimeException("Unimplemented");
        }
        
        public double getNumericDoubleAt(int byteOffset)
          throws DebugVC50WrongNumericTypeException
        {
          throw new RuntimeException("Unimplemented");
        }
        
        public byte[] getNumericDataAt(int byteOffset)
          throws DebugVC50WrongNumericTypeException
        {
          throw new RuntimeException("Unimplemented");
        }
        
        private void loadTypeRecord()
        {
          seek(typeRecordOffset);
          typeRecordSize = (readShort() & 0xFFFF);
          typeStringOffset = (typeRecordOffset + 2);
          loadTypeString();
        }
        
        private void loadTypeString()
        {
          seek(typeStringOffset);
          int lo = readByte() & 0xFF;
          if (lo >= 240)
          {
            typeStringLeaf = lo;
          }
          else
          {
            int hi = readByte() & 0xFF;
            typeStringLeaf = (hi << 8 | lo);
          }
        }
        
        private void typeSeek(int offset)
        {
          seek(typeStringOffset + offset);
        }
        
        private int typeStringLength()
        {
          if ((typeStringLeaf >= 240) && (typeStringLeaf <= 255)) {
            return typeStringLeaf - 240;
          }
          switch (typeStringLeaf)
          {
          case 4097: 
            return 8;
          case 4098: 
            int extraLen = 0;
            int attr = (getPointerAttributes() & 0x1F) >> 0;
            int mode = (getPointerAttributes() & 0xE0) >> 5;
            if (attr == 8) {
              extraLen = 4 + numericLeafLengthAt(typeStringOffset + 14);
            } else if ((mode == 2) || (mode == 3)) {
              extraLen = 6;
            }
            return 10 + extraLen;
          case 4099: 
            int temp = 10 + numericLeafLengthAt(10);
            return temp + lengthPrefixedStringLengthAt(temp);
          case 4100: 
          case 4101: 
            int temp = 18 + numericLeafLengthAt(18);
            return temp + lengthPrefixedStringLengthAt(temp);
          case 4102: 
            int temp = 10 + numericLeafLengthAt(10);
            return temp + lengthPrefixedStringLengthAt(temp);
          case 4103: 
            return 14 + lengthPrefixedStringLengthAt(14);
          case 4104: 
            return 14;
          case 4105: 
            return 26;
          case 10: 
            return 4 + (getVTShapeCount() + 1) / 2;
          case 12: 
          case 4106: 
            throw new COFFException("COBOL symbols unimplemented");
          case 4107: 
            return 6;
          case 14: 
            return 4;
          case 15: 
            return 2;
          case 16: 
            return 2;
          case 4108: 
            return 10 + lengthPrefixedStringLengthAt(10);
          case 4109: 
            return 6 + 4 * getVFTPathCount();
          case 4110: 
            return 14 + lengthPrefixedStringLengthAt(14);
          case 20: 
            return 6;
          case 4111: 
            throw new COFFException("OEM symbols unimplemented");
          case 22: 
            return 10 + lengthPrefixedStringLengthAt(10);
          case 4608: 
            return 6 + numericLeafLengthAt(6);
          case 4609: 
            return 6 + 4 * getArgListCount();
          case 4610: 
            return 6 + lengthPrefixedStringLengthAt(6);
          case 4611: 
            return 2;
          case 4612: 
            return 6 + 4 * getDerivedCount();
          case 4613: 
            return 8;
          case 4614: 
            return 6 + 4 * getMListLength() + (isMListIntroducingVirtual() ? 4 : 0);
          case 4615: 
          case 4616: 
          case 4617: 
          case 4618: 
            throw new COFFException("LF_DIMCONU, LF_DIMCONLU, LF_DIMVARU, and LF_DIMVARLU unsupported");
          case 524: 
            seek(typeStringOffset + 2);
            return 4 + readShort();
          case 5120: 
            return 8 + numericLeafLengthAt(8);
          case 5121: 
          case 5122: 
            int temp = 12 + numericLeafLengthAt(12);
            return temp + numericLeafLengthAt(temp);
          case 1027: 
            int temp = 4 + numericLeafLengthAt(4);
            return temp + lengthPrefixedStringLengthAt(temp);
          case 5123: 
            return 8 + lengthPrefixedStringLengthAt(8);
          case 5124: 
            return 8;
          case 5125: 
            int temp = 8 + numericLeafLengthAt(8);
            return temp + lengthPrefixedStringLengthAt(temp);
          case 5126: 
            return 8 + lengthPrefixedStringLengthAt(8);
          case 5127: 
            return 8 + lengthPrefixedStringLengthAt(8);
          case 5128: 
            return 8 + lengthPrefixedStringLengthAt(8);
          case 5129: 
            return 8;
          case 5130: 
            return 8;
          case 5131: 
            int baseLen = 8 + (isOneMethodIntroducingVirtual() ? 4 : 0);
            return baseLen + lengthPrefixedStringLengthAt(baseLen);
          case 5132: 
            return 12;
          case 5133: 
            return 8 + lengthPrefixedStringLengthAt(8);
          case 5134: 
            return 8 + lengthPrefixedStringLengthAt(8);
          case 32768: 
          case 32769: 
          case 32770: 
          case 32771: 
          case 32772: 
          case 32773: 
          case 32774: 
          case 32775: 
          case 32776: 
          case 32777: 
          case 32778: 
          case 32779: 
          case 32780: 
          case 32781: 
          case 32782: 
          case 32783: 
          case 32784: 
            throw new RuntimeException("Unexpected numeric leaf " + typeStringLeaf + "in type string");
          }
          throw new COFFException("Unrecognized leaf " + typeStringLeaf + " in type string at offset " + typeStringOffset);
        }
        
        private boolean isIntroducingVirtual(int mprop)
        {
          int masked = mprop & 0x1C;
          return (masked == 16) || (masked == 24);
        }
        
        private int numericLeafLengthAt(int offset)
        {
          return COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this.numericLeafLengthAt(typeStringOffset + offset);
        }
        
        private int readIntNumericLeafAt(int offset)
        {
          return COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this.readIntNumericLeafAt(typeStringOffset + offset);
        }
        
        private int lengthPrefixedStringLengthAt(int offset)
        {
          return COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this.lengthPrefixedStringLengthAt(typeStringOffset + offset);
        }
        
        private String readLengthPrefixedStringAt(int offset)
        {
          return COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this.readLengthPrefixedStringAt(typeStringOffset + offset);
        }
      }
      
      private int numericLeafLengthAt(int absoluteOffset)
        throws DebugVC50WrongNumericTypeException
      {
        seek(absoluteOffset);
        int leaf = readShort() & 0xFFFF;
        if (leaf < 32768) {
          return 2;
        }
        switch (leaf)
        {
        case 32768: 
          return 3;
        case 32769: 
        case 32770: 
          return 4;
        case 32771: 
        case 32772: 
          return 6;
        case 32773: 
          return 6;
        case 32774: 
          return 10;
        case 32775: 
          return 12;
        case 32776: 
          return 18;
        case 32777: 
        case 32778: 
          return 18;
        case 32779: 
          return 8;
        case 32780: 
          return 10;
        case 32781: 
          return 18;
        case 32782: 
          return 26;
        case 32783: 
          return 66;
        case 32784: 
          return 4 + readIntNumericLeafAt(absoluteOffset + 2);
        }
        throw new DebugVC50WrongNumericTypeException("Illegal numeric leaf index " + leaf + " at offset " + absoluteOffset);
      }
      
      private int readIntNumericLeafAt(int absoluteOffset)
        throws DebugVC50WrongNumericTypeException
      {
        seek(absoluteOffset);
        int leaf = readShort() & 0xFFFF;
        if (leaf < 32768) {
          return leaf;
        }
        switch (leaf)
        {
        case 32768: 
          return readByte() & 0xFF;
        case 32769: 
        case 32770: 
          return readShort() & 0xFFFF;
        case 32771: 
        case 32772: 
          return readInt();
        }
        throw new DebugVC50WrongNumericTypeException("Illegal numeric leaf index " + leaf);
      }
      
      private long readLongNumericLeafAt(int absoluteOffset)
        throws DebugVC50WrongNumericTypeException
      {
        seek(absoluteOffset);
        int leaf = readShort() & 0xFFFF;
        if (leaf < 32768) {
          return leaf;
        }
        switch (leaf)
        {
        case 32768: 
          return readByte() & 0xFF;
        case 32769: 
        case 32770: 
          return readShort() & 0xFFFF;
        case 32771: 
        case 32772: 
          return readInt() & 0xFFFFFFFF;
        case 32777: 
        case 32778: 
          return readLong();
        }
        throw new DebugVC50WrongNumericTypeException("Illegal numeric leaf index " + leaf);
      }
      
      private float readFloatNumericLeafAt(int absoluteOffset)
        throws DebugVC50WrongNumericTypeException
      {
        seek(absoluteOffset);
        int leaf = readShort() & 0xFFFF;
        if (leaf != 32773) {
          throw new DebugVC50WrongNumericTypeException("Illegal numeric leaf index " + leaf);
        }
        return readFloat();
      }
      
      private double readDoubleNumericLeafAt(int absoluteOffset)
        throws DebugVC50WrongNumericTypeException
      {
        seek(absoluteOffset);
        int leaf = readShort() & 0xFFFF;
        if (leaf != 32774) {
          throw new DebugVC50WrongNumericTypeException("Illegal numeric leaf index " + leaf);
        }
        return readDouble();
      }
      
      private int lengthPrefixedStringLengthAt(int absoluteOffset)
      {
        seek(absoluteOffset);
        int len = readByte() & 0xFF;
        return 1 + len;
      }
      
      private String readLengthPrefixedStringAt(int absoluteOffset)
      {
        seek(absoluteOffset);
        int len = readByte() & 0xFF;
        byte[] res = new byte[len];
        int numRead = readBytes(res);
        if (numRead != len) {
          throw new COFFException("Error reading length prefixed string in symbol at offset " + absoluteOffset);
        }
        try
        {
          return new String(res, "US-ASCII");
        }
        catch (UnsupportedEncodingException e)
        {
          throw new COFFException(e);
        }
      }
      
      private int unbiasTypeIndex(int index)
      {
        return index - 4096;
      }
      
      private int biasTypeIndex(int index)
      {
        return index + 4096;
      }
    }
    
    class SectionHeaderImpl
      implements SectionHeader
    {
      private String name;
      private int virtualSize;
      private int virtualAddress;
      private int sizeOfRawData;
      private int pointerToRawData;
      private int pointerToRelocations;
      private int pointerToLineNumbers;
      private short numberOfRelocations;
      private short numberOfLineNumbers;
      private int characteristics;
      private MemoizedObject[] relocations;
      private MemoizedObject[] lineNumbers;
      
      public SectionHeaderImpl(int offset)
        throws COFFException
      {
        seek(offset);
        
        byte[] tmpName = new byte[8];
        int numRead = readBytes(tmpName);
        if (numRead != 8) {
          throw new COFFException("Error reading name of section header at offset " + offset);
        }
        if (tmpName[0] == 47)
        {
          int index = 0;
          try
          {
            index = Integer.parseInt(new String(tmpName, 1, tmpName.length - 1, "US-ASCII"));
          }
          catch (NumberFormatException e)
          {
            throw new COFFException("Error parsing string table index of name of section header at offset " + offset);
          }
          catch (UnsupportedEncodingException e)
          {
            throw new COFFException(e);
          }
          name = getStringTable().get(index);
 
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