sa-jdi

DataDirectory)dataDirectories[checkIndex(13)].getValue();
        }
        
        public DataDirectory getCOMPlusRuntimeHeader()
          throws COFFException
        {
          return (DataDirectory)dataDirectories[checkIndex(14)].getValue();
        }
        
        public ExportDirectoryTable getExportDirectoryTable()
          throws COFFException
        {
          return (ExportDirectoryTable)exportDirectoryTable.getValue();
        }
        
        public DebugDirectory getDebugDirectory()
          throws COFFException
        {
          return (DebugDirectory)debugDirectory.getValue();
        }
        
        private int checkIndex(int index)
          throws COFFException
        {
          if ((index < 0) || (index >= dataDirectories.length)) {
            throw new COFFException("Directory " + index + " unavailable (only " + numberOfRvaAndSizes + " tables present)");
          }
          return index;
        }
      }
      
      class DataDirectoryImpl
        implements DataDirectory
      {
        int rva;
        int size;
        
        DataDirectoryImpl(int offset)
        {
          seek(offset);
          rva = readInt();
          size = readInt();
        }
        
        public int getRVA()
        {
          return rva;
        }
        
        public int getSize()
        {
          return size;
        }
      }
      
      class ExportDirectoryTableImpl
        implements ExportDirectoryTable
      {
        private int exportDataDirRVA;
        private int offset;
        private int size;
        private int exportFlags;
        private int timeDateStamp;
        private short majorVersion;
        private short minorVersion;
        private int nameRVA;
        private int ordinalBase;
        private int addressTableEntries;
        private int numberOfNamePointers;
        private int exportAddressTableRVA;
        private int namePointerTableRVA;
        private int ordinalTableRVA;
        private MemoizedObject dllName;
        private MemoizedObject exportNameTable;
        private MemoizedObject exportNamePointerTable;
        private MemoizedObject exportOrdinalTable;
        private MemoizedObject exportAddressTable;
        
        ExportDirectoryTableImpl(int exportDataDirRVA, int size)
        {
          this.exportDataDirRVA = exportDataDirRVA;
          offset = rvaToFileOffset(exportDataDirRVA);
          this.size = size;
          seek(offset);
          exportFlags = readInt();
          timeDateStamp = readInt();
          majorVersion = readShort();
          minorVersion = readShort();
          nameRVA = readInt();
          ordinalBase = readInt();
          addressTableEntries = readInt();
          numberOfNamePointers = readInt();
          exportAddressTableRVA = readInt();
          namePointerTableRVA = readInt();
          ordinalTableRVA = readInt();
          
          dllName = new MemoizedObject()
          {
            public Object computeValue()
            {
              seek(rvaToFileOffset(getNameRVA()));
              return readCString();
            }
          };
          exportNamePointerTable = new MemoizedObject()
          {
            public Object computeValue()
            {
              int[] pointers = new int[getNumberOfNamePointers()];
              seek(rvaToFileOffset(getNamePointerTableRVA()));
              for (int i = 0; i < pointers.length; i++) {
                pointers[i] = readInt();
              }
              for (int i = 0; i < pointers.length; i++) {
                pointers[i] = rvaToFileOffset(pointers[i]);
              }
              return pointers;
            }
          };
          exportNameTable = new MemoizedObject()
          {
            public Object computeValue()
            {
              return new COFFFileParser.COFFFileImpl.COFFHeaderImpl.ExportNameTable(COFFFileParser.COFFFileImpl.COFFHeaderImpl.this, COFFFileParser.COFFFileImpl.COFFHeaderImpl.ExportDirectoryTableImpl.this.getExportNamePointerTable());
            }
          };
          exportOrdinalTable = new MemoizedObject()
          {
            public Object computeValue()
            {
              short[] ordinals = new short[getNumberOfNamePointers()];
              seek(rvaToFileOffset(getOrdinalTableRVA()));
              for (int i = 0; i < ordinals.length; i++) {
                ordinals[i] = readShort();
              }
              return ordinals;
            }
          };
          exportAddressTable = new MemoizedObject()
          {
            public Object computeValue()
            {
              int[] addresses = new int[getNumberOfAddressTableEntries()];
              seek(rvaToFileOffset(getExportAddressTableRVA()));
              for (int i = 0; i < addresses.length; i++) {
                addresses[i] = readInt();
              }
              return addresses;
            }
          };
        }
        
        public int getExportFlags()
        {
          return exportFlags;
        }
        
        public int getTimeDateStamp()
        {
          return timeDateStamp;
        }
        
        public short getMajorVersion()
        {
          return majorVersion;
        }
        
        public short getMinorVersion()
        {
          return minorVersion;
        }
        
        public int getNameRVA()
        {
          return nameRVA;
        }
        
        public String getDLLName()
        {
          return (String)dllName.getValue();
        }
        
        public int getOrdinalBase()
        {
          return ordinalBase;
        }
        
        public int getNumberOfAddressTableEntries()
        {
          return addressTableEntries;
        }
        
        public int getNumberOfNamePointers()
        {
          return numberOfNamePointers;
        }
        
        public int getExportAddressTableRVA()
        {
          return exportAddressTableRVA;
        }
        
        public int getNamePointerTableRVA()
        {
          return namePointerTableRVA;
        }
        
        public int getOrdinalTableRVA()
        {
          return ordinalTableRVA;
        }
        
        public String getExportName(int i)
        {
          return getExportNameTable().get(i);
        }
        
        public short getExportOrdinal(int i)
        {
          return getExportOrdinalTable()[i];
        }
        
        public boolean isExportAddressForwarder(short ordinal)
        {
          int addr = getExportAddress(ordinal);
          return (exportDataDirRVA <= addr) && (addr < exportDataDirRVA + size);
        }
        
        public String getExportAddressForwarder(short ordinal)
        {
          seek(rvaToFileOffset(getExportAddress(ordinal)));
          return readCString();
        }
        
        public int getExportAddress(short ordinal)
        {
          return getExportAddressTable()[ordinal];
        }
        
        private COFFFileParser.COFFFileImpl.COFFHeaderImpl.ExportNameTable getExportNameTable()
        {
          return (COFFFileParser.COFFFileImpl.COFFHeaderImpl.ExportNameTable)exportNameTable.getValue();
        }
        
        private int[] getExportNamePointerTable()
        {
          return (int[])exportNamePointerTable.getValue();
        }
        
        private short[] getExportOrdinalTable()
        {
          return (short[])exportOrdinalTable.getValue();
        }
        
        private int[] getExportAddressTable()
        {
          return (int[])exportAddressTable.getValue();
        }
      }
      
      class ExportNameTable
      {
        private MemoizedObject[] names;
        
        ExportNameTable(final int[] exportNamePointerTable)
        {
          names = new MemoizedObject[exportNamePointerTable.length];
          for (int i = 0; i < exportNamePointerTable.length; i++)
          {
            final int idx = i;
            names[idx = new MemoizedObject()
            {
              public Object computeValue()
              {
                seek(exportNamePointerTable[idx]);
                return readCString();
              }
            };
          }
        }
        
        String get(int i)
        {
          return (String)names[i].getValue();
        }
      }
      
      class DebugDirectoryImpl
        implements DebugDirectory
      {
        private int offset;
        private int size;
        private int numEntries;
        private static final int DEBUG_DIRECTORY_ENTRY_SIZE = 28;
        
        DebugDirectoryImpl(int offset, int size)
        {
          this.offset = offset;
          this.size = size;
          if (size % 28 != 0) {
            throw new COFFException("Corrupt DebugDirectory at offset 0x" + Integer.toHexString(offset));
          }
          numEntries = (size / 28);
        }
        
        public int getNumEntries()
        {
          return numEntries;
        }
        
        public DebugDirectoryEntry getEntry(int i)
        {
          if ((i < 0) || (i >= getNumEntries())) {
            throw new IndexOutOfBoundsException();
          }
          return new COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugDirectoryEntryImpl(COFFFileParser.COFFFileImpl.COFFHeaderImpl.this, offset + i * 28);
        }
      }
      
      class DebugDirectoryEntryImpl
        implements DebugDirectoryEntry, DebugTypes
      {
        private int characteristics;
        private int timeDateStamp;
        private short majorVersion;
        private short minorVersion;
        private int type;
        private int sizeOfData;
        private int addressOfRawData;
        private int pointerToRawData;
        
        DebugDirectoryEntryImpl(int offset)
        {
          seek(offset);
          characteristics = readInt();
          timeDateStamp = readInt();
          majorVersion = readShort();
          minorVersion = readShort();
          type = readInt();
          sizeOfData = readInt();
          addressOfRawData = readInt();
          pointerToRawData = readInt();
        }
        
        public int getCharacteristics()
        {
          return characteristics;
        }
        
        public int getTimeDateStamp()
        {
          return timeDateStamp;
        }
        
        public short getMajorVersion()
        {
          return majorVersion;
        }
        
        public short getMinorVersion()
        {
          return minorVersion;
        }
        
        public int getType()
        {
          return type;
        }
        
        public int getSizeOfData()
        {
          return sizeOfData;
        }
        
        public int getAddressOfRawData()
        {
          return addressOfRawData;
        }
        
        public int getPointerToRawData()
        {
          return pointerToRawData;
        }
        
        public DebugVC50 getDebugVC50()
        {
          try
          {
            if (getType() != 2) {
              return null;
            }
            int offset = getPointerToRawData();
            seek(offset);
            if ((readByte() == 78) && (readByte() == 66) && (readByte() == 49) && (readByte() == 49)) {
              return new COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl(COFFFileParser.COFFFileImpl.COFFHeaderImpl.this, offset);
            }
          }
          catch (COFFException e)
          {
            e.printStackTrace();
          }
          return null;
        }
        
        public byte getRawDataByte(int i)
        {
          if ((i < 0) || (i >= getSizeOfData())) {
            throw new IndexOutOfBoundsException();
          }
          seek(getPointerToRawData() + i);
          return readByte();
        }
      }
      
      class DebugVC50Impl
        implements DebugVC50, DebugVC50TypeLeafIndices
      {
        private int lfaBase;
        private int subsectionDirectoryOffset;
        private MemoizedObject subsectionDirectory;
        
        DebugVC50Impl(int offset)
        {
          lfaBase = offset;
          seek(offset);
          readInt();
          subsectionDirectoryOffset = globalOffset(readInt());
          
          verify();
          
          subsectionDirectory = new MemoizedObject()
          {
            public Object computeValue()
            {
              return new COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SubsectionDirectoryImpl(COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this, getSubsectionDirectoryOffset());
            }
          };
        }
        
        public int getSubsectionDirectoryOffset()
        {
          return subsectionDirectoryOffset;
        }
        
        public DebugVC50SubsectionDirectory getSubsectionDirectory()
        {
          return (DebugVC50SubsectionDirectory)subsectionDirectory.getValue();
        }
        
        private int globalOffset(int offset)
        {
          return offset + lfaBase;
        }
        
        private void verify()
        {
          seek(subsectionDirectoryOffset);
          int headerLength = readShort();
          int entryLength = readShort();
          int numEntries = readInt();
          int endOffset = subsectionDirectoryOffset + headerLength + numEntries * entryLength;
          seek(endOffset);
          if ((readByte() == 78) && (readByte() == 66) && (readByte() == 49) && (readByte() == 49)) {
            return;
          }
          throw new COFFException("Did not find NB11 signature at end of debug info");
        }
        
        class DebugVC50SubsectionDirectoryImpl
          implements DebugVC50SubsectionDirectory, DebugVC50SubsectionTypes
        {
          private int offset;
          private short dirHeaderLength;
          private short dirEntryLength;
          private int numEntries;
          
          DebugVC50SubsectionDirectoryImpl(int offset)
          {
            this.offset = offset;
            
            seek(offset);
            dirHeaderLength = readShort();
            dirEntryLength = readShort();
            numEntries = readInt();
          }
          
          public short getHeaderLength()
          {
            return dirHeaderLength;
          }
          
          public short getEntryLength()
          {
            return dirEntryLength;
          }
          
          public int getNumEntries()
          {
            return numEntries;
          }
          
          public DebugVC50Subsection getSubsection(int i)
          {
            seek(offset + dirHeaderLength + i * dirEntryLength);
            short ssType = readShort();
            short iMod = readShort();
            int lfo = COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this.globalOffset(readInt());
            int cb = readInt();
            switch (ssType)
            {
            case 288: 
              return new COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SSModuleImpl(COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this, ssType, iMod, cb, lfo);
            case 289: 
              return new COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SSTypesImpl(COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this, ssType, iMod, cb, lfo);
            case 290: 
              return new COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SSPublicImpl(COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this, ssType, iMod, cb, lfo);
            case 291: 
              return new COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SSPublicSymImpl(COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this, ssType, iMod, cb, lfo);
            case 292: 
              return new COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SSSymbolsImpl(COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this, ssType, iMod, cb, lfo);
            case 293: 
              return new COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SSAlignSymImpl(COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this, ssType, iMod, cb, lfo);
            case 294: 
              return new COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SSSrcLnSegImpl(COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this, ssType, iMod, cb, lfo);
            case 295: 
              return new COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SSSrcModuleImpl(COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this, ssType, iMod, cb, lfo);
            case 296: 
              return new COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SSLibrariesImpl(COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this, ssType, iMod, cb, lfo);
            case 297: 
              return new COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SSGlobalSymImpl(COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this, ssType, iMod, cb, lfo);
            case 298: 
              return new COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SSGlobalPubImpl(COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this, ssType, iMod, cb, lfo);
            case 299: 
              return new COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SSGlobalTypesImpl(COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this, ssType, iMod, cb, lfo);
            case 300: 
              return new COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SSMPCImpl(COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this, ssType, iMod, cb, lfo);
            case 301: 
              return new COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SSSegMapImpl(COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this, ssType, iMod, cb, lfo);
            case 302: 
              return new COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SSSegNameImpl(COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this, ssType, iMod, cb, lfo);
            case 303: 
              return new COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SSPreCompImpl(COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this, ssType, iMod, cb, lfo);
            case 304: 
              return null;
            case 305: 
              return new COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SSOffsetMap16Impl(COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this, ssType, iMod, cb, lfo);
            case 306: 
              return new COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SSOffsetMap32Impl(COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this, ssType, iMod, cb, lfo);
            case 307: 
              return new COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SSFileIndexImpl(COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this, ssType, iMod, cb, lfo);
            case 308: 
              return new COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SSStaticSymImpl(COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this, ssType, iMod, cb, lfo);
            }
            throw new COFFException("Unknown section type " + ssType);
          }
        }
        
        class DebugVC50SubsectionImpl
          implements DebugVC50Subsection
        {
          private short ssType;
          private short iMod;
          private int ssSize;
          
          DebugVC50SubsectionImpl(short ssType, short iMod, int ssSize, int offset)
          {
            this.ssType = ssType;
            this.iMod = iMod;
            this.ssSize = ssSize;
          }
          
          public short getSubsectionType()
          {
            return ssType;
          }
          
          public short getSubsectionModuleIndex()
          {
            return iMod;
          }
          
          public int getSubsectionSize()
          {
            return ssSize;
          }
        }
        
        class DebugVC50SSModuleImpl
          extends COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SubsectionImpl
          implements DebugVC50SSModule
        {
          private int offset;
          private short ovlNumber;
          private short iLib;
          private short cSeg;
          private short style;
          private MemoizedObject segInfo;
          private MemoizedObject name;
          private static final int HEADER_SIZE = 8;
          private static final int SEG_INFO_SIZE = 12;
          
          DebugVC50SSModuleImpl(short ssType, short iMod, int ssSize, final int offset)
          {
            super(ssType, iMod, ssSize, offset);
            this.offset = offset;
            seek(offset);
            ovlNumber = readShort();
            iLib = readShort();
            cSeg = readShort();
            style = readShort();
            segInfo = new MemoizedObject()
            {
              public Object computeValue()
              {
                int base = offset + 8;
                DebugVC50SegInfo[] res = new DebugVC50SegInfo[cSeg];
                for (int i = 0; i < cSeg; i++)
                {
                  res[i] = new COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SegInfoImpl(COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this, base);
                  base += 12;
                }
                return res;
              }
            };
            name = new MemoizedObject()
            {
              public Object computeValue()
              {
                return COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this.readLengthPrefixedStringAt(offset + (8 + cSeg * 12));
              }
            };
          }
          
          public short getOverlayNumber()
          {
            return ovlNumber;
          }
          
          public short getLibrariesIndex()
          {
            return iLib;
          }
          
          public short getNumCodeSegments()
          {
            return cSeg;
          }
          
          public short getDebuggingStyle()
          {
            return style;
          }
          
          public DebugVC50SegInfo getSegInfo(int i)
          {
            return ((DebugVC50SegInfo[])(DebugVC50SegInfo[])segInfo.getValue())[i];
          }
          
          public String getName()
          {
            return (String)name.getValue();
          }
        }
        
        class DebugVC50SegInfoImpl
          implements DebugVC50SegInfo
        {
          private short seg;
          private int offset;
          private int cbSeg;
          
          DebugVC50SegInfoImpl(int offset)
          {
            seek(offset);
            seg = readShort();
            readShort();
            offset = readInt();
            cbSeg = readInt();
          }
          
          public short getSegment()
          {
            return seg;
          }
          
          public int getOffset()
          {
            return offset;
          }
          
          public int getSegmentCodeSize()
          {
            return cbSeg;
          }
        }
        
        class DebugVC50SSTypesImpl
          extends COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SubsectionImpl
          implements DebugVC50SSTypes
        {
          DebugVC50SSTypesImpl(short ssType, short iMod, int ssSize, int offset)
          {
            super(ssType, iMod, ssSize, offset);
          }
        }
        
        class DebugVC50SSPublicImpl
          extends COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SubsectionImpl
          implements DebugVC50SSPublic
        {
          DebugVC50SSPublicImpl(short ssType, short iMod, int ssSize, int offset)
          {
            super(ssType, iMod, ssSize, offset);
          }
        }
        
        class DebugVC50SSPublicSymImpl
          extends COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SubsectionImpl
          implements DebugVC50SSPublicSym
        {
          DebugVC50SSPublicSymImpl(short ssType, short iMod, int ssSize, int offset)
          {
            super(ssType, iMod, ssSize, offset);
          }
        }
        
        class DebugVC50SSSymbolsImpl
          extends COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SubsectionImpl
          implements DebugVC50SSSymbols
        {
          DebugVC50SSSymbolsImpl(short ssType, short iMod, int ssSize, int offset)
          {
            super(ssType, iMod, ssSize, offset);
          }
        }
        
        class DebugVC50SSAlignSymImpl
          extends COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SubsectionImpl
          implements DebugVC50SSAlignSym
        {
          private int offset;
          
          DebugVC50SSAlignSymImpl(short ssType, short iMod, int ssSize, int offset)
          {
            super(ssType, iMod, ssSize, offset);
            this.offset = offset;
          }
          
          public DebugVC50SymbolIterator getSymbolIterator()
          {
            return new COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SymbolIteratorImpl(COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this, offset, getSubsectionSize());
          }
        }
        
        class DebugVC50SSSrcLnSegImpl
          extends COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SubsectionImpl
          implements DebugVC50SSSrcLnSeg
        {
          DebugVC50SSSrcLnSegImpl(short ssType, short iMod, int ssSize, int offset)
          {
            super(ssType, iMod, ssSize, offset);
          }
        }
        
        class DebugVC50SSSrcModuleImpl
          extends COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SubsectionImpl
          implements DebugVC50SSSrcModule
        {
          private int offset;
          private short cFile;
          private short cSeg;
          private MemoizedObject baseSrcFiles;
          private MemoizedObject segOffsets;
          private MemoizedObject segs;
          
          DebugVC50SSSrcModuleImpl(short ssType, short iMod, int ssSize, final int offset)
          {
            super(ssType, iMod, ssSize, offset);
            
            this.offset = offset;
            seek(offset);
            cFile = readShort();
            cSeg = readShort();
            
            baseSrcFiles = new MemoizedObject()
            {
              public Object computeValue()
              {
                int[] offsets = new int[getNumSourceFiles()];
                seek(offset + 4);
                for (int i = 0; i < getNumSourceFiles(); i++) {
                  offsets[i] = (offset + readInt());
                }
                COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SrcModFileDescImpl[] res = new COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SrcModFileDescImpl[offsets.length];
                for (int i = 0; i < res.length; i++) {
                  res[i] = new COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SrcModFileDescImpl(COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this, offsets[i], offset);
                }
                return res;
              }
            };
            segOffsets = new MemoizedObject()
            {
              public Object computeValue()
              {
                seek(offset + 4 * (getNumSourceFiles() + 1));
                int[] res = new int[2 * getNumCodeSegments()];
                for (int i = 0; i < 2 * getNumCodeSegments(); i++) {
                  res[i] = readInt();
                }
                return res;
              }
            };
            segs = new MemoizedObject()
            {
              public Object computeValue()
              {
                seek(offset + 4 * (getNumSourceFiles() + 1) + 8 * getNumCodeSegments());
                short[] res = new short[getNumCodeSegments()];
                for (int i = 0; i < getNumCodeSegments(); i++) {
                  res[i] = readShort();
                }
                return res;
              }
            };
          }
          
          public int getNumSourceFiles()
          {
            return cFile & 0xFFFF;
          }
          
          public int getNumCodeSegments()
          {
            return cSeg & 0xFFFF;
          }
          
          public DebugVC50SrcModFileDesc getSourceFileDesc(int i)
          {
            return ((COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SrcModFileDescImpl[])(COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SrcModFileDescImpl[])baseSrcFiles.getValue())[i];
          }
          
          public int getSegmentStartOffset(int i)
          {
            return ((int[])(int[])segOffsets.getValue())[(2 * i)];
          }
          
          public int getSegmentEndOffset(int i)
          {
            return ((int[])(int[])segOffsets.getValue())[(2 * i + 1)];
          }
          
          public int getSegment(int i)
          {
            return ((short[])(short[])segs.getValue())[i] & 0xFFFF;
          }
        }
        
        class DebugVC50SrcModFileDescImpl
          implements DebugVC50SrcModFileDesc
        {
          private short cSeg;
          private MemoizedObject baseSrcLn;
          private MemoizedObject segOffsets;
          private MemoizedObject name;
          
          DebugVC50SrcModFileDescImpl(final int offset, final int baseOffset)
          {
            seek(offset);
            cSeg = readShort();
            
            baseSrcLn = new MemoizedObject()
            {
              public Object computeValue()
              {
                seek(offset + 4);
                int[] offsets = new int[getNumCodeSegments()];
                for (int i = 0; i < getNumCodeSegments(); i++) {
                  offsets[i] = (baseOffset + readInt());
                }
                COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SrcModLineNumberMapImpl[] res = new COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SrcModLineNumberMapImpl[getNumCodeSegments()];
                for (int i = 0; i < getNumCodeSegments(); i++) {
                  res[i] = new COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SrcModLineNumberMapImpl(COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this, offsets[i]);
                }
                return res;
              }
            };
            segOffsets = new MemoizedObject()
            {
              public Object computeValue()
              {
                seek(offset + 4 * (getNumCodeSegments() + 1));
                int[] res = new int[2 * getNumCodeSegments()];
                for (int i = 0; i < 2 * getNumCodeSegments(); i++) {
                  res[i] = readInt();
                }
                return res;
              }
            };
            name = new MemoizedObject()
            {
              public Object computeValue()
              {
                seek(offset + 4 + 12 * getNumCodeSegments());
                
                int cbName = readByte() & 0xFF;
                byte[] res = new byte[cbName];
                readBytes(res);
                try
                {
                  return new String(res, "US-ASCII");
                }
                catch (UnsupportedEncodingException e)
                {
                  throw new COFFException(e);
                }
              }
            };
          }
          
          public int getNumCodeSegments()
          {
            return cSeg & 0xFFFF;
          }
          
          public DebugVC50SrcModLineNumberMap getLineNumberMap(int i)
          {
            return ((COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SrcModLineNumberMapImpl[])(COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SrcModLineNumberMapImpl[])baseSrcLn.getValue())[i];
          }
          
          public int getSegmentStartOffset(int i)
          {
            return ((int[])(int[])segOffsets.getValue())[(2 * i)];
          }
          
          public int getSegmentEndOffset(int i)
          {
            return ((int[])(int[])segOffsets.getValue())[(2 * i + 1)];
          }
          
          public String getSourceFileName()
          {
            return (String)name.getValue();
          }
        }
        
        class DebugVC50SrcModLineNumberMapImpl
          implements DebugVC50SrcModLineNumberMap
        {
          private short seg;
          private short cPair;
          private MemoizedObject offsets;
          private MemoizedObject lineNumbers;
          
          DebugVC50SrcModLineNumberMapImpl(final int offset)
          {
            seek(offset);
            seg = readShort();
            cPair = readShort();
            offsets = new MemoizedObject()
            {
              public Object computeValue()
              {
                seek(offset + 4);
                int[] res = new int[getNumSourceLinePairs()];
                for (int i = 0; i < getNumSourceLinePairs(); i++) {
                  res[i] = readInt();
                }
                return res;
              }
            };
            lineNumbers = new MemoizedObject()
            {
              public Object computeValue()
              {
                seek(offset + 4 * (getNumSourceLinePairs() + 1));
                short[] res = new short[getNumSourceLinePairs()];
                for (int i = 0; i < getNumSourceLinePairs(); i++) {
                  res[i] = readShort();
                }
                return res;
              }
            };
          }
          
          public int getSegment()
          {
            return seg;
          }
          
          public int getNumSourceLinePairs()
          {
            return cPair;
          }
          
          public int getCodeOffset(int i)
          {
            return ((int[])(int[])offsets.getValue())[i];
          }
          
          public int getLineNumber(int i)
          {
            return ((short[])(short[])lineNumbers.getValue())[i] & 0xFFFF;
          }
        }
        
        class DebugVC50SSLibrariesImpl
          extends COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SubsectionImpl
          implements DebugVC50SSLibraries
        {
          DebugVC50SSLibrariesImpl(short ssType, short iMod, int ssSize, int offset)
          {
            super(ssType, iMod, ssSize, offset);
          }
        }
        
        class DebugVC50SSSymbolBaseImpl
          extends COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SubsectionImpl
          implements DebugVC50SSSymbolBase
        {
          private int offset;
          private short symHash;
          private short addrHash;
          private int cbSymbol;
          private int cbSymHash;
          private int cbAddrHash;
          private static final int HEADER_SIZE = 16;
          
          DebugVC50SSSymbolBaseImpl(short ssType, short iMod, int ssSize, int offset)
          {
            super(ssType, iMod, ssSize, offset);
            this.offset = offset;
            seek(offset);
            symHash = readShort();
            addrHash = readShort();
            cbSymbol = readInt();
            cbSymHash = readInt();
            cbAddrHash = readInt();
          }
          
          public short getSymHashIndex()
          {
            return symHash;
          }
          
          public short getAddrHashIndex()
          {
            return addrHash;
          }
          
          public int getSymTabSize()
          {
            return cbSymbol;
          }
          
          public int getSymHashSize()
          {
            return cbSymHash;
          }
          
          public int getAddrHashSize()
          {
            return cbAddrHash;
          }
          
          public DebugVC50SymbolIterator getSymbolIterator()
          {
            return new COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SymbolIteratorImpl(COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this, offset + 16, cbSymbol);
          }
        }
        
        class DebugVC50SSGlobalSymImpl
          extends COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SSSymbolBaseImpl
          implements DebugVC50SSGlobalSym
        {
          DebugVC50SSGlobalSymImpl(short ssType, short iMod, int ssSize, int offset)
          {
            super(ssType, iMod, ssSize, offset);
          }
        }
        
        class DebugVC50SSGlobalPubImpl
          extends COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SSSymbolBaseImpl
          implements DebugVC50SSGlobalPub
        {
          DebugVC50SSGlobalPubImpl(short ssType, short iMod, int ssSize, int offset)
          {
            super(ssType, iMod, ssSize, offset);
          }
        }
        
        class DebugVC50SSGlobalTypesImpl
          extends COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SubsectionImpl
          implements DebugVC50SSGlobalTypes
        {
          private int offset;
          private int cType;
          
          DebugVC50SSGlobalTypesImpl(short ssType, short iMod, int ssSize, int offset)
          {
            super(ssType, iMod, ssSize, offset);
            this.offset = offset;
            seek(offset);
            readInt();
            cType = readInt();
          }
          
          public int getNumTypes()
          {
            return cType;
          }
          
          public int getTypeOffset(int i)
          {
            seek(offset + 4 * (i + 2));
            return readInt() + offsetOfFirstType();
          }
          
          public DebugVC50TypeIterator getTypeIterator()
          {
            return new COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50TypeIteratorImpl(COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this, this, offsetOfFirstType(), cType);
          }
          
          private int offsetOfFirstType()
          {
            return offset + 4 * (getNumTypes() + 2);
          }
        }
        
        class DebugVC50SSMPCImpl
          extends COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SubsectionImpl
          implements DebugVC50SSMPC
        {
          DebugVC50SSMPCImpl(short ssType, short iMod, int ssSize, int offset)
          {
            super(ssType, iMod, ssSize, offset);
          }
        }
        
        class DebugVC50SSSegMapImpl
          extends COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SubsectionImpl
          implements DebugVC50SSSegMap
        {
          private short cSeg;
          private short cSegLog;
          private MemoizedObject segDescs;
          
          DebugVC50SSSegMapImpl(short ssType, short iMod, int ssSize, final int offset)
          {
            super(ssType, iMod, ssSize, offset);
            seek(offset);
            cSeg = readShort();
            cSegLog = readShort();
            segDescs = new MemoizedObject()
            {
              public Object computeValue()
              {
                DebugVC50SegDesc[] descs = new DebugVC50SegDesc[cSeg];
                for (int i = 0; i < cSeg; i++) {
                  descs[i] = new COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.DebugVC50SegDescImpl(COFFFileParser.COFFFileImpl.COFFHeaderImpl.DebugVC50Impl.this, offset + 4 + 20 * i);
                }
                return descs;
              }
            };
          }
          
          public short getNumSegDesc()
          {
            return cSeg;
          }
          
          public short getNumLogicalSegDesc()
          {
 
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