sa-jdi

 b)
    throws IOException
  {
    for (int i = 0; i < b.length; i++) {
      b[i] = readByte();
    }
    return b.length;
  }
  
  public void seek(long pos)
    throws IOException
  {
    offset = pos;
  }
  
  public long getFilePointer()
    throws IOException
  {
    return offset;
  }
  
  public void close()
    throws IOException
  {}
}

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

import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.DebuggerException;
import sun.jvm.hotspot.debugger.ThreadContext;
import sun.jvm.hotspot.debugger.ThreadProxy;
import sun.jvm.hotspot.debugger.windbg.WindbgDebugger;

class WindbgAMD64Thread
  implements ThreadProxy
{
  private WindbgDebugger debugger;
  private long sysId;
  private boolean gotID;
  private long id;
  
  WindbgAMD64Thread(WindbgDebugger debugger, Address addr)
  {
    this.debugger = debugger;
    
    sysId = ((int)addr.addOffsetTo(debugger.getAddressSize()).getCIntegerAt(0L, 4L, true));
    gotID = false;
  }
  
  WindbgAMD64Thread(WindbgDebugger debugger, long sysId)
  {
    this.debugger = debugger;
    this.sysId = sysId;
    gotID = false;
  }
  
  public ThreadContext getContext()
    throws IllegalThreadStateException
  {
    long[] data = debugger.getThreadIntegerRegisterSet(getThreadID());
    WindbgAMD64ThreadContext context = new WindbgAMD64ThreadContext(debugger);
    for (int i = 0; i < data.length; i++) {
      context.setRegister(i, data[i]);
    }
    return context;
  }
  
  public boolean canSetContext()
    throws DebuggerException
  {
    return false;
  }
  
  public void setContext(ThreadContext thrCtx)
    throws IllegalThreadStateException, DebuggerException
  {
    throw new DebuggerException("Unimplemented");
  }
  
  public boolean equals(Object obj)
  {
    if ((obj == null) || (!(obj instanceof WindbgAMD64Thread))) {
      return false;
    }
    return ((WindbgAMD64Thread)obj).getThreadID() == getThreadID();
  }
  
  public int hashCode()
  {
    return (int)getThreadID();
  }
  
  public String toString()
  {
    return Long.toString(getThreadID());
  }
  
  private long getThreadID()
  {
    if (!gotID) {
      id = debugger.getThreadIdFromSysId(sysId);
    }
    return id;
  }
}

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

import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.amd64.AMD64ThreadContext;
import sun.jvm.hotspot.debugger.windbg.WindbgDebugger;

class WindbgAMD64ThreadContext
  extends AMD64ThreadContext
{
  private WindbgDebugger debugger;
  
  public WindbgAMD64ThreadContext(WindbgDebugger debugger)
  {
    this.debugger = debugger;
  }
  
  public void setRegisterAsAddress(int index, Address value)
  {
    setRegister(index, debugger.getAddressValue(value));
  }
  
  public Address getRegisterAsAddress(int index)
  {
    return debugger.newAddress(getRegister(index));
  }
}

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

import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.ThreadProxy;
import sun.jvm.hotspot.debugger.windbg.WindbgDebugger;
import sun.jvm.hotspot.debugger.windbg.WindbgThreadFactory;

public class WindbgAMD64ThreadFactory
  implements WindbgThreadFactory
{
  private WindbgDebugger debugger;
  
  public WindbgAMD64ThreadFactory(WindbgDebugger debugger)
  {
    this.debugger = debugger;
  }
  
  public ThreadProxy createThreadWrapper(Address threadIdentifierAddr)
  {
    return new WindbgAMD64Thread(debugger, threadIdentifierAddr);
  }
  
  public ThreadProxy createThreadWrapper(long id)
  {
    return new WindbgAMD64Thread(debugger, id);
  }
}

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

import sun.jvm.hotspot.debugger.win32.coff.COFFFileParser;
import sun.jvm.hotspot.utilities.memo.MemoizedObject;

final class DLL$1
  extends MemoizedObject
{
  private final DLL this$0;
  
  DLL$1(DLL paramDLL) {}
  
  public Object computeValue()
  {
    return COFFFileParser.getParser().parse(DLL.access$000(this$0));
  }
}

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

import sun.jvm.hotspot.debugger.win32.coff.COFFFileParser;
import sun.jvm.hotspot.utilities.memo.MemoizedObject;

final class DLL$2
  extends MemoizedObject
{
  private final DLL this$0;
  
  DLL$2(DLL paramDLL) {}
  
  public Object computeValue()
  {
    return COFFFileParser.getParser().parse(new AddressDataSource(DLL.access$100(this$0)));
  }
}

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

import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.DebuggerException;
import sun.jvm.hotspot.debugger.cdbg.BlockSym;
import sun.jvm.hotspot.debugger.cdbg.CDebugInfoDataBase;
import sun.jvm.hotspot.debugger.cdbg.ClosestSymbol;
import sun.jvm.hotspot.debugger.cdbg.LineNumberInfo;
import sun.jvm.hotspot.debugger.cdbg.LoadObject;
import sun.jvm.hotspot.debugger.win32.coff.COFFException;
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.ExportDirectoryTable;
import sun.jvm.hotspot.debugger.win32.coff.OptionalHeader;
import sun.jvm.hotspot.debugger.win32.coff.OptionalHeaderDataDirectories;
import sun.jvm.hotspot.utilities.Assert;
import sun.jvm.hotspot.utilities.memo.MemoizedObject;

public class DLL
  implements LoadObject
{
  private WindbgDebugger dbg;
  private String fullPathName;
  private long size;
  private MemoizedObject file;
  private Address addr;
  private CDebugInfoDataBase db;
  
  public DLL(WindbgDebugger dbg, String filename, long size, Address relocation)
    throws COFFException
  {
    this.dbg = dbg;
    fullPathName = filename;
    this.size = size;
    file = new MemoizedObject()
    {
      public Object computeValue()
      {
        return COFFFileParser.getParser().parse(fullPathName);
      }
    };
    addr = relocation;
  }
  
  public DLL(Address base)
    throws COFFException
  {
    addr = base;
    file = new MemoizedObject()
    {
      public Object computeValue()
      {
        return COFFFileParser.getParser().parse(new AddressDataSource(addr));
      }
    };
  }
  
  public boolean isDLL()
  {
    return getFile().getHeader().hasCharacteristic((short)8192);
  }
  
  public Address lookupSymbol(String symbol)
    throws COFFException
  {
    if (!isDLL()) {
      return null;
    }
    ExportDirectoryTable exports = getExportDirectoryTable();
    return lookupSymbol(symbol, exports, 0, exports.getNumberOfNamePointers() - 1);
  }
  
  public Address getBase()
  {
    return addr;
  }
  
  public String getName()
  {
    return fullPathName;
  }
  
  public long getSize()
  {
    return size;
  }
  
  public CDebugInfoDataBase getDebugInfoDataBase()
    throws DebuggerException
  {
    if (db != null) {
      return db;
    }
    if (dbg == null) {
      return null;
    }
    if (Assert.ASSERTS_ENABLED) {
      Assert.that(fullPathName != null, "Need full path name to build debug info database");
    }
    db = new WindbgCDebugInfoBuilder(dbg).buildDataBase(fullPathName, addr);
    return db;
  }
  
  public BlockSym debugInfoForPC(Address pc)
    throws DebuggerException
  {
    CDebugInfoDataBase db = getDebugInfoDataBase();
    if (db == null) {
      return null;
    }
    return db.debugInfoForPC(pc);
  }
  
  public ClosestSymbol closestSymbolToPC(Address pcAsAddr)
    throws DebuggerException
  {
    ExportDirectoryTable exports = getExportDirectoryTable();
    if (exports == null) {
      return null;
    }
    String name = null;
    long pc = dbg.getAddressValue(pcAsAddr);
    long diff = Long.MAX_VALUE;
    long base = dbg.getAddressValue(addr);
    for (int i = 0; i < exports.getNumberOfNamePointers(); i++) {
      if (!exports.isExportAddressForwarder(exports.getExportOrdinal(i)))
      {
        long tmp = base + (exports.getExportAddress(exports.getExportOrdinal(i)) & 0xFFFFFFFF);
        if ((tmp <= pc) && (pc - tmp < diff))
        {
          diff = pc - tmp;
          name = exports.getExportName(i);
        }
      }
    }
    if (name == null) {
      return null;
    }
    return new ClosestSymbol(name, diff);
  }
  
  public LineNumberInfo lineNumberForPC(Address pc)
    throws DebuggerException
  {
    CDebugInfoDataBase db = getDebugInfoDataBase();
    if (db == null) {
      return null;
    }
    return db.lineNumberForPC(pc);
  }
  
  public void close()
  {
    getFile().close();
    file = null;
  }
  
  private COFFFile getFile()
  {
    return (COFFFile)file.getValue();
  }
  
  private Address lookupSymbol(String symbol, ExportDirectoryTable exports, int loIdx, int hiIdx)
  {
    do
    {
      int curIdx = loIdx + hiIdx >> 1;
      String cur = exports.getExportName(curIdx);
      if (symbol.equals(cur)) {
        return addr.addOffsetTo(exports.getExportAddress(exports.getExportOrdinal(curIdx)) & 0xFFFFFFFF);
      }
      if (symbol.compareTo(cur) < 0)
      {
        if (hiIdx == curIdx) {
          hiIdx = curIdx - 1;
        } else {
          hiIdx = curIdx;
        }
      }
      else if (loIdx == curIdx) {
        loIdx = curIdx + 1;
      } else {
        loIdx = curIdx;
      }
    } while (loIdx <= hiIdx);
    return null;
  }
  
  private ExportDirectoryTable getExportDirectoryTable()
  {
    return getFile().getHeader().getOptionalHeader().getDataDirectories().getExportDirectoryTable();
  }
}

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

import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.DebuggerException;
import sun.jvm.hotspot.debugger.ThreadContext;
import sun.jvm.hotspot.debugger.ThreadProxy;
import sun.jvm.hotspot.debugger.windbg.WindbgDebugger;

class WindbgIA64Thread
  implements ThreadProxy
{
  private WindbgDebugger debugger;
  private long sysId;
  private boolean gotID;
  private long id;
  
  WindbgIA64Thread(WindbgDebugger debugger, Address addr)
  {
    this.debugger = debugger;
    
    sysId = ((int)addr.addOffsetTo(debugger.getAddressSize()).getCIntegerAt(0L, 4L, true));
    gotID = false;
  }
  
  WindbgIA64Thread(WindbgDebugger debugger, long sysId)
  {
    this.debugger = debugger;
    this.sysId = sysId;
    gotID = false;
  }
  
  public ThreadContext getContext()
    throws IllegalThreadStateException
  {
    long[] data = debugger.getThreadIntegerRegisterSet(getThreadID());
    WindbgIA64ThreadContext context = new WindbgIA64ThreadContext(debugger);
    for (int i = 0; i < data.length; i++) {
      context.setRegister(i, data[i]);
    }
    return context;
  }
  
  public boolean canSetContext()
    throws DebuggerException
  {
    return false;
  }
  
  public void setContext(ThreadContext thrCtx)
    throws IllegalThreadStateException, DebuggerException
  {
    throw new DebuggerException("Unimplemented");
  }
  
  public boolean equals(Object obj)
  {
    if ((obj == null) || (!(obj instanceof WindbgIA64Thread))) {
      return false;
    }
    return ((WindbgIA64Thread)obj).getThreadID() == getThreadID();
  }
  
  public int hashCode()
  {
    return (int)getThreadID();
  }
  
  public String toString()
  {
    return Long.toString(getThreadID());
  }
  
  private long getThreadID()
  {
    if (!gotID) {
      id = debugger.getThreadIdFromSysId(sysId);
    }
    return id;
  }
}

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

import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.ia64.IA64ThreadContext;
import sun.jvm.hotspot.debugger.windbg.WindbgDebugger;

class WindbgIA64ThreadContext
  extends IA64ThreadContext
{
  private WindbgDebugger debugger;
  
  public WindbgIA64ThreadContext(WindbgDebugger debugger)
  {
    this.debugger = debugger;
  }
  
  public void setRegisterAsAddress(int index, Address value)
  {
    setRegister(index, debugger.getAddressValue(value));
  }
  
  public Address getRegisterAsAddress(int index)
  {
    return debugger.newAddress(getRegister(index));
  }
}

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

import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.ThreadProxy;
import sun.jvm.hotspot.debugger.windbg.WindbgDebugger;
import sun.jvm.hotspot.debugger.windbg.WindbgThreadFactory;

public class WindbgIA64ThreadFactory
  implements WindbgThreadFactory
{
  private WindbgDebugger debugger;
  
  public WindbgIA64ThreadFactory(WindbgDebugger debugger)
  {
    this.debugger = debugger;
  }
  
  public ThreadProxy createThreadWrapper(Address threadIdentifierAddr)
  {
    return new WindbgIA64Thread(debugger, threadIdentifierAddr);
  }
  
  public ThreadProxy createThreadWrapper(long id)
  {
    return new WindbgIA64Thread(debugger, id);
  }
}

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

import java.io.PrintStream;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.DebuggerException;
import sun.jvm.hotspot.debugger.NotInHeapException;
import sun.jvm.hotspot.debugger.OopHandle;
import sun.jvm.hotspot.debugger.UnalignedAddressException;
import sun.jvm.hotspot.debugger.UnmappedAddressException;

class WindbgAddress
  implements Address
{
  protected WindbgDebugger debugger;
  protected long addr;
  
  WindbgAddress(WindbgDebugger debugger, long addr)
  {
    this.debugger = debugger;
    this.addr = addr;
  }
  
  public boolean equals(Object arg)
  {
    if (arg == null) {
      return false;
    }
    if (!(arg instanceof WindbgAddress)) {
      return false;
    }
    return addr == addr;
  }
  
  public int hashCode()
  {
    return (int)addr;
  }
  
  public String toString()
  {
    return debugger.addressValueToString(addr);
  }
  
  public long getCIntegerAt(long offset, long numBytes, boolean isUnsigned)
    throws UnalignedAddressException, UnmappedAddressException
  {
    return debugger.readCInteger(addr + offset, numBytes, isUnsigned);
  }
  
  public Address getAddressAt(long offset)
    throws UnalignedAddressException, UnmappedAddressException
  {
    return debugger.readAddress(addr + offset);
  }
  
  public Address getCompOopAddressAt(long offset)
    throws UnalignedAddressException, UnmappedAddressException
  {
    return debugger.readCompOopAddress(addr + offset);
  }
  
  public boolean getJBooleanAt(long offset)
    throws UnalignedAddressException, UnmappedAddressException
  {
    return debugger.readJBoolean(addr + offset);
  }
  
  public byte getJByteAt(long offset)
    throws UnalignedAddressException, UnmappedAddressException
  {
    return debugger.readJByte(addr + offset);
  }
  
  public char getJCharAt(long offset)
    throws UnalignedAddressException, UnmappedAddressException
  {
    return debugger.readJChar(addr + offset);
  }
  
  public double getJDoubleAt(long offset)
    throws UnalignedAddressException, UnmappedAddressException
  {
    return debugger.readJDouble(addr + offset);
  }
  
  public float getJFloatAt(long offset)
    throws UnalignedAddressException, UnmappedAddressException
  {
    return debugger.readJFloat(addr + offset);
  }
  
  public int getJIntAt(long offset)
    throws UnalignedAddressException, UnmappedAddressException
  {
    return debugger.readJInt(addr + offset);
  }
  
  public long getJLongAt(long offset)
    throws UnalignedAddressException, UnmappedAddressException
  {
    return debugger.readJLong(addr + offset);
  }
  
  public short getJShortAt(long offset)
    throws UnalignedAddressException, UnmappedAddressException
  {
    return debugger.readJShort(addr + offset);
  }
  
  public OopHandle getOopHandleAt(long offset)
    throws UnalignedAddressException, UnmappedAddressException, NotInHeapException
  {
    return debugger.readOopHandle(addr + offset);
  }
  
  public OopHandle getCompOopHandleAt(long offset)
    throws UnalignedAddressException, UnmappedAddressException, NotInHeapException
  {
    return debugger.readCompOopHandle(addr + offset);
  }
  
  public void setCIntegerAt(long offset, long numBytes, long value)
  {
    throw new DebuggerException("Unimplemented");
  }
  
  public void setAddressAt(long offset, Address value)
  {
    throw new DebuggerException("Unimplemented");
  }
  
  public void setJBooleanAt(long offset, boolean value)
    throws UnmappedAddressException, UnalignedAddressException
  {
    throw new DebuggerException("Unimplemented");
  }
  
  public void setJByteAt(long offset, byte value)
    throws UnmappedAddressException, UnalignedAddressException
  {
    throw new DebuggerException("Unimplemented");
  }
  
  public void setJCharAt(long offset, char value)
    throws UnmappedAddressException, UnalignedAddressException
  {
    throw new DebuggerException("Unimplemented");
  }
  
  public void setJDoubleAt(long offset, double value)
    throws UnmappedAddressException, UnalignedAddressException
  {
    throw new DebuggerException("Unimplemented");
  }
  
  public void setJFloatAt(long offset, float value)
    throws UnmappedAddressException, UnalignedAddressException
  {
    throw new DebuggerException("Unimplemented");
  }
  
  public void setJIntAt(long offset, int value)
    throws UnmappedAddressException, UnalignedAddressException
  {
    throw new DebuggerException("Unimplemented");
  }
  
  public void setJLongAt(long offset, long value)
    throws UnmappedAddressException, UnalignedAddressException
  {
    throw new DebuggerException("Unimplemented");
  }
  
  public void setJShortAt(long offset, short value)
    throws UnmappedAddressException, UnalignedAddressException
  {
    throw new DebuggerException("Unimplemented");
  }
  
  public void setOopHandleAt(long offset, OopHandle value)
    throws UnmappedAddressException, UnalignedAddressException
  {
    throw new DebuggerException("Unimplemented");
  }
  
  public Address addOffsetTo(long offset)
    throws UnsupportedOperationException
  {
    long value = addr + offset;
    if (value == 0L) {
      return null;
    }
    return new WindbgAddress(debugger, value);
  }
  
  public OopHandle addOffsetToAsOopHandle(long offset)
    throws UnsupportedOperationException
  {
    long value = addr + offset;
    if (value == 0L) {
      return null;
    }
    return new WindbgOopHandle(debugger, value);
  }
  
  public long minus(Address arg)
  {
    if (arg == null) {
      return addr;
    }
    return addr - addr;
  }
  
  public boolean lessThan(Address a)
  {
    if (a == null) {
      return false;
    }
    WindbgAddress arg = (WindbgAddress)a;
    if ((addr >= 0L) && (addr < 0L)) {
      return true;
    }
    if ((addr < 0L) && (addr >= 0L)) {
      return false;
    }
    return addr < addr;
  }
  
  public boolean lessThanOrEqual(Address a)
  {
    if (a == null) {
      return false;
    }
    WindbgAddress arg = (WindbgAddress)a;
    if ((addr >= 0L) && (addr < 0L)) {
      return true;
    }
    if ((addr < 0L) && (addr >= 0L)) {
      return false;
    }
    return addr <= addr;
  }
  
  public boolean greaterThan(Address a)
  {
    if (a == null) {
      return true;
    }
    WindbgAddress arg = (WindbgAddress)a;
    if ((addr >= 0L) && (addr < 0L)) {
      return false;
    }
    if ((addr < 0L) && (addr >= 0L)) {
      return true;
    }
    return addr > addr;
  }
  
  public boolean greaterThanOrEqual(Address a)
  {
    if (a == null) {
      return true;
    }
    WindbgAddress arg = (WindbgAddress)a;
    if ((addr >= 0L) && (addr < 0L)) {
      return false;
    }
    if ((addr < 0L) && (addr >= 0L)) {
      return true;
    }
    return addr >= addr;
  }
  
  public Address andWithMask(long mask)
    throws UnsupportedOperationException
  {
    long value = addr & mask;
    if (value == 0L) {
      return null;
    }
    return new WindbgAddress(debugger, value);
  }
  
  public Address orWithMask(long mask)
    throws UnsupportedOperationException
  {
    long value = addr | mask;
    if (value == 0L) {
      return null;
    }
    return new WindbgAddress(debugger, value);
  }
  
  public Address xorWithMask(long mask)
    throws UnsupportedOperationException
  {
    long value = addr ^ mask;
    if (value == 0L) {
      return null;
    }
    return new WindbgAddress(debugger, value);
  }
  
  long getValue()
  {
    return addr;
  }
  
  private static void check(boolean arg, String failMessage)
  {
    if (!arg)
    {
      System.err.println(failMessage + ": FAILED");
      System.exit(1);
    }
  }
  
  public static void main(String[] args)
  {
    WindbgAddress p1 = new WindbgAddress(null, 9223372036854775792L);
    WindbgAddress p2 = (WindbgAddress)p1.addOffsetTo(10L);
    WindbgAddress n1 = (WindbgAddress)p2.addOffsetTo(10L);
    WindbgAddress n2 = (WindbgAddress)n1.addOffsetTo(10L);
    
    check(p1.lessThan(p2), "lessThan 1");
    check(p1.lessThan(n1), "lessThan 2");
    check(p1.lessThan(n2), "lessThan 3");
    check(p2.lessThan(n1), "lessThan 4");
    check(p2.lessThan(n2), "lessThan 5");
    check(n1.lessThan(n2), "lessThan 6");
    
    check(!p1.lessThan(p1), "lessThan 7");
    check(!p2.lessThan(p2), "lessThan 8");
    check(!n1.lessThan(n1), "lessThan 9");
    check(!n2.lessThan(n2), "lessThan 10");
    
    check(!p2.lessThan(p1), "lessThan 11");
    check(!n1.lessThan(p1), "lessThan 12");
    check(!n2.lessThan(p1), "lessThan 13");
    check(!n1.lessThan(p2), "lessThan 14");
    check(!n2.lessThan(p2), "lessThan 15");
    check(!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("WindbgAddress: all tests passed successfully.");
  }
}

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

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.amd64.AMD64ThreadContext;
import sun.jvm.hotspot.debugger.cdbg.CDebugger;
import sun.jvm.hotspot.debugger.cdbg.CFrame;
import sun.jvm.hotspot.debugger.cdbg.LoadObject;
import sun.jvm.hotspot.debugger.cdbg.ProcessControl;
import sun.jvm.hotspot.debugger.cdbg.basic.amd64.AMD64CFrame;
import sun.jvm.hotspot.debugger.cdbg.basic.x86.X86CFrame;
import sun.jvm.hotspot.debugger.x86.X86ThreadContext;
import sun.jvm.hotspot.utilities.AddressOps;

class WindbgCDebugger
  implements CDebugger
{
  private WindbgDebugger dbg;
  
  WindbgCDebugger(WindbgDebugger 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
  {
    if (dbg.getCPU().equals("x86"))
    {
      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);
    }
    if (dbg.getCPU().equals("amd64"))
    {
      AMD64ThreadContext context = (AMD64ThreadContext)thread.getContext();
      Address rbp = context.getRegisterAsAddress(10);
      if (rbp == null) {
        return null;
      }
      Address pc = context.getRegisterAsAddress(17);
      if (pc == null) {
        return null;
      }
      return new AMD64CFrame(this, rbp, pc);
    }
    return null;
  }
  
  public String getNameOfFile(String fileName)
  {
    return new File(fileName).getName();
  }
  
  public ProcessControl getProcessControl()
    throws DebuggerException
  {
    return null;
  }
  
  public boolean canDemangle()
  {
    return false;
  }
  
  public String demangle(String sym)
  {
    throw new UnsupportedOperationException();
  }
}

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

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 WindbgCDebugInfoBuilder$1
  implements ResolveListener
{
  private final WindbgCDebugInfoBuilder this$0;
  
  WindbgCDebugInfoBuilder$1(WindbgCDebugInfoBuilder paramWindbgCDebugInfoBuilder) {}
  
  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.windbg.WindbgCDebugInfoBuilder.1
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.debugger.windbg;

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 WindbgCDebugInfoBuilder
  implements DebugVC50SubsectionTypes, DebugVC50TypeLeafIndices, DebugVC50TypeEnums, DebugVC50SymbolTypes, DebugVC50MemberAttributes, CVAttributes, AccessControl
{
  private WindbgDebugger 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;
  
  WindbgCDebugInfoBuilder(WindbgDebugger 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: 
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