sa-jdi

  
  public abstract int getPointerToLineNumbers();
  
  public abstract short getNumberOfRelocations();
  
  public abstract short getNumberOfLineNumbers();
  
  public abstract int getSectionFlags();
  
  public abstract boolean hasSectionFlag(int paramInt);
  
  public abstract COFFRelocation getCOFFRelocation(int paramInt);
  
  public abstract COFFLineNumber getCOFFLineNumber(int paramInt);
}

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

import java.io.PrintStream;

public class TestDebugInfo
  implements DebugVC50SubsectionTypes, DebugVC50SymbolTypes, DebugVC50TypeLeafIndices
{
  public static void main(String[] args)
  {
    if (args.length != 1)
    {
      System.err.println("usage: java TestParser [file name]");
      System.err.println("File name may be an .exe, .dll or .obj");
      System.exit(1);
    }
    try
    {
      COFFFile file = COFFFileParser.getParser().parse(args[0]);
      if (file.isImage()) {
        System.out.println("PE Image detected.");
      } else {
        System.out.println("PE Image NOT detected, assuming object file.");
      }
      DebugVC50 vc50 = getDebugVC50(file);
      if (vc50 == null)
      {
        System.out.println("No debug information found.");
        System.exit(1);
      }
      else
      {
        System.out.println("Debug information found!");
      }
      DebugVC50SubsectionDirectory dir = vc50.getSubsectionDirectory();
      for (int i = 0; i < dir.getNumEntries(); i++)
      {
        DebugVC50Subsection sec = dir.getSubsection(i);
        switch (sec.getSubsectionType())
        {
        case 288: 
          System.out.println("  SST_MODULE"); break;
        case 289: 
          System.out.println("  SST_TYPES"); break;
        case 290: 
          System.out.println("  SST_PUBLIC"); break;
        case 291: 
          System.out.println("  SST_PUBLIC_SYM"); break;
        case 292: 
          System.out.println("  SST_SYMBOLS"); break;
        case 293: 
          System.out.println("  SST_ALIGN_SYM");printSymbolTable(((DebugVC50SSAlignSym)sec).getSymbolIterator()); break;
        case 294: 
          System.out.println("  SST_SRC_LN_SEG"); break;
        case 295: 
          System.out.println("  SST_SRC_MODULE"); break;
        case 296: 
          System.out.println("  SST_LIBRARIES"); break;
        case 297: 
          System.out.println("  SST_GLOBAL_SYM");printSymbolTable(sec); break;
        case 298: 
          System.out.println("  SST_GLOBAL_PUB");printSymbolTable(sec); break;
        case 299: 
          System.out.println("  SST_GLOBAL_TYPES");printTypeTable(sec); break;
        case 300: 
          System.out.println("  SST_MPC"); break;
        case 301: 
          System.out.println("  SST_SEG_MAP"); break;
        case 302: 
          System.out.println("  SST_SEG_NAME"); break;
        case 303: 
          System.out.println("  SST_PRE_COMP"); break;
        case 304: 
          System.out.println("  SST_UNUSED"); break;
        case 305: 
          System.out.println("  SST_OFFSET_MAP_16"); break;
        case 306: 
          System.out.println("  SST_OFFSET_MAP_32"); break;
        case 307: 
          System.out.println("  SST_FILE_INDEX"); break;
        case 308: 
          System.out.println("  SST_STATIC_SYM");printSymbolTable(sec); break;
        default: 
          System.out.println("  (Unknown subsection type " + sec.getSubsectionType() + ")");
        }
      }
    }
    catch (Exception e)
    {
      e.printStackTrace();
    }
  }
  
  private static DebugVC50 getDebugVC50(COFFFile file)
  {
    COFFHeader header = file.getHeader();
    OptionalHeader opt = header.getOptionalHeader();
    if (opt == null)
    {
      System.out.println("Optional header not found.");
      return null;
    }
    OptionalHeaderDataDirectories dd = opt.getDataDirectories();
    if (dd == null)
    {
      System.out.println("Optional header data directories not found.");
      return null;
    }
    DebugDirectory debug = dd.getDebugDirectory();
    if (debug == null)
    {
      System.out.println("Debug directory not found.");
      return null;
    }
    for (int i = 0; i < debug.getNumEntries(); i++)
    {
      DebugDirectoryEntry entry = debug.getEntry(i);
      if (entry.getType() == 2)
      {
        System.out.println("Debug Directory Entry " + i + " has debug type IMAGE_DEBUG_TYPE_CODEVIEW");
        return entry.getDebugVC50();
      }
    }
    return null;
  }
  
  private static void printSymbolTable(DebugVC50Subsection sec)
  {
    DebugVC50SSSymbolBase sym = (DebugVC50SSSymbolBase)sec;
    DebugVC50SymbolIterator iter = sym.getSymbolIterator();
    printSymbolTable(iter);
  }
  
  private static void printSymbolTable(DebugVC50SymbolIterator iter)
  {
    while (!iter.done())
    {
      int type = iter.getType() & 0xFFFF;
      switch (type)
      {
      case 1: 
        System.out.println("    S_COMPILE"); break;
      case 5: 
        System.out.println("    S_SSEARCH"); break;
      case 6: 
        System.out.println("    S_END"); break;
      case 7: 
        System.out.println("    S_SKIP"); break;
      case 8: 
        System.out.println("    S_CVRESERVE"); break;
      case 9: 
        System.out.println("    S_OBJNAME"); break;
      case 10: 
        System.out.println("    S_ENDARG"); break;
      case 11: 
        System.out.println("    S_COBOLUDT"); break;
      case 12: 
        System.out.println("    S_MANYREG"); break;
      case 13: 
        System.out.println("    S_RETURN"); break;
      case 14: 
        System.out.println("    S_ENTRYTHIS"); break;
      case 4097: 
        System.out.println("    S_REGISTER"); break;
      case 4098: 
        System.out.println("    S_CONSTANT"); break;
      case 4099: 
        System.out.println("    S_UDT"); break;
      case 4100: 
        System.out.println("    S_COBOLUDT2"); break;
      case 4101: 
        System.out.println("    S_MANYREG2"); break;
      case 4102: 
        System.out.println("    S_BPREL32"); break;
      case 4103: 
        System.out.println("    S_LDATA32"); break;
      case 4104: 
        System.out.println("    S_GDATA32"); break;
      case 4105: 
        System.out.println("    S_PUB32"); break;
      case 4106: 
        System.out.println("    S_LPROC32"); break;
      case 4107: 
        System.out.println("    S_GPROC32"); break;
      case 518: 
        System.out.println("    S_THUNK32"); break;
      case 519: 
        System.out.println("    S_BLOCK32"); break;
      case 520: 
        System.out.println("    S_WITH32"); break;
      case 521: 
        System.out.println("    S_LABEL32"); break;
      case 522: 
        System.out.println("    S_CEXMODEL32"); break;
      case 4108: 
        System.out.println("    S_VFTTABLE32"); break;
      case 4109: 
        System.out.println("    S_REGREL32"); break;
      case 4110: 
        System.out.println("    S_LTHREAD32"); break;
      case 4111: 
        System.out.println("    S_GTHREAD32"); break;
      case 4112: 
        System.out.println("    S_LPROCMIPS"); break;
      case 4113: 
        System.out.println("    S_GPROCMIPS"); break;
      case 1024: 
        System.out.println("    S_PROCREF"); break;
      case 1025: 
        System.out.println("    S_DATAREF"); break;
      case 1026: 
        System.out.println("    S_ALIGN"); break;
      default: 
        System.out.println("    (Unknown symbol type " + type + ")");
      }
      iter.next();
    }
  }
  
  private static void printTypeTable(DebugVC50Subsection sec)
  {
    DebugVC50SSGlobalTypes types = (DebugVC50SSGlobalTypes)sec;
    
    DebugVC50TypeIterator iter = types.getTypeIterator();
    while (!iter.done())
    {
      System.out.print("    Type string: ");
      while (!iter.typeStringDone())
      {
        int leaf = iter.typeStringLeaf() & 0xFFFF;
        switch (leaf)
        {
        case 4097: 
          System.out.print("LF_MODIFIER "); break;
        case 4098: 
          System.out.print("LF_POINTER "); break;
        case 4099: 
          System.out.print("LF_ARRAY "); break;
        case 4100: 
          System.out.print("LF_CLASS "); break;
        case 4101: 
          System.out.print("LF_STRUCTURE "); break;
        case 4102: 
          System.out.print("LF_UNION "); break;
        case 4103: 
          System.out.print("LF_ENUM "); break;
        case 4104: 
          System.out.print("LF_PROCEDURE "); break;
        case 4105: 
          System.out.print("LF_MFUNCTION "); break;
        case 10: 
          System.out.print("LF_VTSHAPE "); break;
        case 4106: 
          System.out.print("LF_COBOL0 "); break;
        case 12: 
          System.out.print("LF_COBOL1 "); break;
        case 4107: 
          System.out.print("LF_BARRAY "); break;
        case 14: 
          System.out.print("LF_LABEL "); break;
        case 15: 
          System.out.print("LF_NULL "); break;
        case 16: 
          System.out.print("LF_NOTTRAN "); break;
        case 4108: 
          System.out.print("LF_DIMARRAY "); break;
        case 4109: 
          System.out.print("LF_VFTPATH "); break;
        case 4110: 
          System.out.print("LF_PRECOMP "); break;
        case 20: 
          System.out.print("LF_ENDPRECOMP "); break;
        case 4111: 
          System.out.print("LF_OEM "); break;
        case 22: 
          System.out.print("LF_TYPESERVER "); break;
        case 4608: 
          System.out.print("LF_SKIP "); break;
        case 4609: 
          System.out.print("LF_ARGLIST "); break;
        case 4610: 
          System.out.print("LF_DEFARG "); break;
        case 4611: 
          System.out.print("LF_FIELDLIST "); break;
        case 4612: 
          System.out.print("LF_DERIVED "); break;
        case 4613: 
          System.out.print("LF_BITFIELD "); break;
        case 4614: 
          System.out.print("LF_METHODLIST "); break;
        case 4615: 
          System.out.print("LF_DIMCONU "); break;
        case 4616: 
          System.out.print("LF_DIMCONLU "); break;
        case 4617: 
          System.out.print("LF_DIMVARU "); break;
        case 4618: 
          System.out.print("LF_DIMVARLU "); break;
        case 524: 
          System.out.print("LF_REFSYM "); break;
        case 5120: 
          System.out.print("LF_BCLASS "); break;
        case 5121: 
          System.out.print("LF_VBCLASS "); break;
        case 5122: 
          System.out.print("LF_IVBCLASS "); break;
        case 1027: 
          System.out.print("LF_ENUMERATE "); break;
        case 5123: 
          System.out.print("LF_FRIENDFCN "); break;
        case 5124: 
          System.out.print("LF_INDEX "); break;
        case 5125: 
          System.out.print("LF_MEMBER ");System.out.print(iter.getMemberName() + " "); break;
        case 5126: 
          System.out.print("LF_STMEMBER "); break;
        case 5127: 
          System.out.print("LF_METHOD ");System.out.print(iter.getMethodName() + " "); break;
        case 5128: 
          System.out.print("LF_NESTTYPE "); break;
        case 5129: 
          System.out.print("LF_VFUNCTAB "); break;
        case 5130: 
          System.out.print("LF_FRIENDCLS "); break;
        case 5131: 
          System.out.print("LF_ONEMETHOD ");System.out.print(iter.getOneMethodName() + " "); break;
        case 5132: 
          System.out.print("LF_VFUNCOFF "); break;
        case 5133: 
          System.out.print("LF_NESTTYPEEX "); break;
        case 5134: 
          System.out.print("LF_MEMBERMODIFY "); break;
        case 32768: 
          System.out.print("LF_CHAR "); break;
        case 32769: 
          System.out.print("LF_SHORT "); break;
        case 32770: 
          System.out.print("LF_USHORT "); break;
        case 32771: 
          System.out.print("LF_LONG "); break;
        case 32772: 
          System.out.print("LF_ULONG "); break;
        case 32773: 
          System.out.print("LF_REAL32 "); break;
        case 32774: 
          System.out.print("LF_REAL64 "); break;
        case 32775: 
          System.out.print("LF_REAL80 "); break;
        case 32776: 
          System.out.print("LF_REAL128 "); break;
        case 32777: 
          System.out.print("LF_QUADWORD "); break;
        case 32778: 
          System.out.print("LF_UQUADWORD "); break;
        case 32779: 
          System.out.print("LF_REAL48 "); break;
        case 32780: 
          System.out.print("LF_COMPLEX32 "); break;
        case 32781: 
          System.out.print("LF_COMPLEX64 "); break;
        case 32782: 
          System.out.print("LF_COMPLEX80 "); break;
        case 32783: 
          System.out.print("LF_COMPLEX128 "); break;
        case 32784: 
          System.out.print("LF_VARSTRING "); break;
        case 240: 
          System.out.print("LF_PAD0 "); break;
        case 241: 
          System.out.print("LF_PAD1 "); break;
        case 242: 
          System.out.print("LF_PAD2 "); break;
        case 243: 
          System.out.print("LF_PAD3 "); break;
        case 244: 
          System.out.print("LF_PAD4 "); break;
        case 245: 
          System.out.print("LF_PAD5 "); break;
        case 246: 
          System.out.print("LF_PAD6 "); break;
        case 247: 
          System.out.print("LF_PAD7 "); break;
        case 248: 
          System.out.print("LF_PAD8 "); break;
        case 249: 
          System.out.print("LF_PAD9 "); break;
        case 250: 
          System.out.print("LF_PAD10 "); break;
        case 251: 
          System.out.print("LF_PAD11 "); break;
        case 252: 
          System.out.print("LF_PAD12 "); break;
        case 253: 
          System.out.print("LF_PAD13 "); break;
        case 254: 
          System.out.print("LF_PAD14 "); break;
        case 255: 
          System.out.print("LF_PAD15 "); break;
        default: 
          System.out.print("(Unknown leaf " + leaf + ")");
        }
        iter.typeStringNext();
      }
      System.out.println("");
      iter.next();
    }
  }
}

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

import java.io.PrintStream;

public class TestParser
{
  public static void main(String[] args)
  {
    if (args.length != 1)
    {
      System.err.println("usage: java TestParser [file name]");
      System.err.println("File name may be an .exe, .dll or .obj");
      System.exit(1);
    }
    try
    {
      COFFFile file = COFFFileParser.getParser().parse(args[0]);
      if (file.isImage()) {
        System.out.println("PE Image detected.");
      } else {
        System.out.println("PE Image NOT detected, assuming object file.");
      }
      COFFHeader header = file.getHeader();
      int numSections = header.getNumberOfSections();
      System.out.println(numSections + " sections detected.");
      for (int i = 1; i <= numSections; i++)
      {
        SectionHeader secHeader = header.getSectionHeader(i);
        System.out.println(secHeader.getName());
      }
      OptionalHeader optHdr = header.getOptionalHeader();
      OptionalHeaderDataDirectories ddirs = optHdr.getDataDirectories();
      ExportDirectoryTable exports = ddirs.getExportDirectoryTable();
      System.out.println("Export flags (should be 0): " + exports.getExportFlags());
      System.out.println("DLL name (from export directory table): " + exports.getDLLName());
      
      int numSymbols = exports.getNumberOfNamePointers();
      System.out.println(numSymbols + " exported symbols detected:");
      for (int i = 0; i < numSymbols; i++) {
        System.out.println("  " + exports.getExportName(i));
      }
    }
    catch (Exception e)
    {
      e.printStackTrace();
    }
  }
}

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

public abstract interface TypeIndicators
{
  public static final short IMAGE_REL_I386_ABSOLUTE = 0;
  public static final short IMAGE_REL_I386_DIR16 = 1;
  public static final short IMAGE_REL_I386_REL16 = 2;
  public static final short IMAGE_REL_I386_DIR32 = 6;
  public static final short IMAGE_REL_I386_DIR32NB = 7;
  public static final short IMAGE_REL_I386_SEG12 = 9;
  public static final short IMAGE_REL_I386_SECTION = 10;
  public static final short IMAGE_REL_I386_SECREL = 11;
  public static final short IMAGE_REL_I386_REL32 = 20;
  public static final short IMAGE_REL_MIPS_ABSOLUTE = 0;
  public static final short IMAGE_REL_MIPS_REFHALF = 1;
  public static final short IMAGE_REL_MIPS_REFWORD = 2;
  public static final short IMAGE_REL_MIPS_JMPADDR = 3;
  public static final short IMAGE_REL_MIPS_REFHI = 4;
  public static final short IMAGE_REL_MIPS_REFLO = 5;
  public static final short IMAGE_REL_MIPS_GPREL = 6;
  public static final short IMAGE_REL_MIPS_LITERAL = 7;
  public static final short IMAGE_REL_MIPS_SECTION = 10;
  public static final short IMAGE_REL_MIPS_SECREL = 11;
  public static final short IMAGE_REL_MIPS_SECRELLO = 12;
  public static final short IMAGE_REL_MIPS_SECRELHI = 13;
  public static final short IMAGE_REL_MIPS_JMPADDR16 = 16;
  public static final short IMAGE_REL_MIPS_REFWORDNB = 34;
  public static final short IMAGE_REL_MIPS_PAIR = 37;
  public static final short IMAGE_REL_ALPHA_ABSOLUTE = 0;
  public static final short IMAGE_REL_ALPHA_REFLONG = 1;
  public static final short IMAGE_REL_ALPHA_REFQUAD = 2;
  public static final short IMAGE_REL_ALPHA_GPREL32 = 3;
  public static final short IMAGE_REL_ALPHA_LITERAL = 4;
  public static final short IMAGE_REL_ALPHA_LITUSE = 5;
  public static final short IMAGE_REL_ALPHA_GPDISP = 6;
  public static final short IMAGE_REL_ALPHA_BRADDR = 7;
  public static final short IMAGE_REL_ALPHA_HINT = 8;
  public static final short IMAGE_REL_ALPHA_INLINE_REFLONG = 9;
  public static final short IMAGE_REL_ALPHA_REFHI = 10;
  public static final short IMAGE_REL_ALPHA_REFLO = 11;
  public static final short IMAGE_REL_ALPHA_PAIR = 12;
  public static final short IMAGE_REL_ALPHA_MATCH = 13;
  public static final short IMAGE_REL_ALPHA_SECTION = 14;
  public static final short IMAGE_REL_ALPHA_SECREL = 15;
  public static final short IMAGE_REL_ALPHA_REFLONGNB = 16;
  public static final short IMAGE_REL_ALPHA_SECRELLO = 17;
  public static final short IMAGE_REL_ALPHA_SECRELHI = 18;
  public static final short IMAGE_REL_ALPHA_REFQ3 = 19;
  public static final short IMAGE_REL_ALPHA_REFQ2 = 20;
  public static final short IMAGE_REL_ALPHA_REFQ1 = 21;
  public static final short IMAGE_REL_ALPHA_GPRELLO = 22;
  public static final short IMAGE_REL_ALPHA_GPRELHI = 23;
  public static final short IMAGE_REL_PPC_ABSOLUTE = 0;
  public static final short IMAGE_REL_PPC_ADDR64 = 1;
  public static final short IMAGE_REL_PPC_ADDR32 = 2;
  public static final short IMAGE_REL_PPC_ADDR24 = 3;
  public static final short IMAGE_REL_PPC_ADDR16 = 4;
  public static final short IMAGE_REL_PPC_ADDR14 = 5;
  public static final short IMAGE_REL_PPC_REL24 = 6;
  public static final short IMAGE_REL_PPC_REL14 = 7;
  public static final short IMAGE_REL_PPC_ADDR32NB = 10;
  public static final short IMAGE_REL_PPC_SECREL = 11;
  public static final short IMAGE_REL_PPC_SECTION = 12;
  public static final short IMAGE_REL_PPC_SECREL16 = 15;
  public static final short IMAGE_REL_PPC_REFHI = 16;
  public static final short IMAGE_REL_PPC_REFLO = 17;
  public static final short IMAGE_REL_PPC_PAIR = 18;
  public static final short IMAGE_REL_PPC_SECRELLO = 19;
  public static final short IMAGE_REL_PPC_SECRELHI = 20;
  public static final short IMAGE_REL_PPC_GPREL = 21;
  public static final short IMAGE_REL_SH3_ABSOLUTE = 0;
  public static final short IMAGE_REL_SH3_DIRECT16 = 1;
  public static final short IMAGE_REL_SH3_DIRECT32 = 2;
  public static final short IMAGE_REL_SH3_DIRECT8 = 3;
  public static final short IMAGE_REL_SH3_DIRECT8_WORD = 4;
  public static final short IMAGE_REL_SH3_DIRECT8_LONG = 5;
  public static final short IMAGE_REL_SH3_DIRECT4 = 6;
  public static final short IMAGE_REL_SH3_DIRECT4_WORD = 7;
  public static final short IMAGE_REL_SH3_DIRECT4_LONG = 8;
  public static final short IMAGE_REL_SH3_PCREL8_WORD = 9;
  public static final short IMAGE_REL_SH3_PCREL8_LONG = 10;
  public static final short IMAGE_REL_SH3_PCREL12_WORD = 11;
  public static final short IMAGE_REL_SH3_STARTOF_SECTION = 12;
  public static final short IMAGE_REL_SH3_SIZEOF_SECTION = 13;
  public static final short IMAGE_REL_SH3_SECTION = 14;
  public static final short IMAGE_REL_SH3_SECREL = 15;
  public static final short IMAGE_REL_SH3_DIRECT32_NB = 16;
  public static final short IMAGE_REL_ARM_ABSOLUTE = 0;
  public static final short IMAGE_REL_ARM_ADDR32 = 1;
  public static final short IMAGE_REL_ARM_ADDR32NB = 2;
  public static final short IMAGE_REL_ARM_BRANCH24 = 3;
  public static final short IMAGE_REL_ARM_BRANCH11 = 4;
  public static final short IMAGE_REL_ARM_SECTION = 14;
  public static final short IMAGE_REL_ARM_SECREL = 15;
}

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

public abstract interface WindowsNTSubsystem
{
  public static final short IMAGE_SUBSYSTEM_UNKNOWN = 0;
  public static final short IMAGE_SUBSYSTEM_NATIVE = 1;
  public static final short IMAGE_SUBSYSTEM_WINDOWS_GUI = 2;
  public static final short IMAGE_SUBSYSTEM_WINDOWS_CUI = 3;
  public static final short IMAGE_SUBSYSTEM_POSIX_CUI = 7;
  public static final short IMAGE_SUBSYSTEM_WINDOWS_CE_GUI = 9;
  public static final short IMAGE_SUBSYSTEM_EFI_APPLICATION = 10;
  public static final short IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER = 11;
  public static final short IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER = 12;
}

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

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.win32.DLL.1
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.debugger.win32;

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.win32.DLL.2
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.debugger.win32;

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;

class DLL
  implements LoadObject
{
  private Win32Debugger dbg;
  private String fullPathName;
  private long size;
  private MemoizedObject file;
  private Address addr;
  private CDebugInfoDataBase db;
  
  DLL(Win32Debugger 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;
  }
  
  DLL(Address base)
    throws COFFException
  {
    addr = base;
    file = new MemoizedObject()
    {
      public Object computeValue()
      {
        return COFFFileParser.getParser().parse(new AddressDataSource(addr));
      }
    };
  }
  
  boolean isDLL()
  {
    return getFile().getHeader().hasCharacteristic((short)8192);
  }
  
  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 Win32CDebugInfoBuilder(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);
  }
  
  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.win32.DLL
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.debugger.win32;

import java.io.PrintStream;
import java.util.Iterator;
import java.util.List;
import sun.jvm.hotspot.debugger.JVMDebugger;
import sun.jvm.hotspot.debugger.MachineDescriptionIntelX86;
import sun.jvm.hotspot.debugger.ProcessInfo;

public class TestDebugger
{
  private static void usage()
  {
    System.out.println("usage: java TestDebugger [pid]");
    System.exit(1);
  }
  
  public static void main(String[] args)
  {
    try
    {
      if (args.length != 1) {
        usage();
      }
      int pid = 0;
      try
      {
        pid = Integer.parseInt(args[0]);
      }
      catch (NumberFormatException e)
      {
        usage();
      }
      JVMDebugger debugger = new Win32DebuggerLocal(new MachineDescriptionIntelX86(), true);
      System.err.println("Process list: ");
      List processes = debugger.getProcessList();
      for (Iterator iter = processes.iterator(); iter.hasNext();)
      {
        ProcessInfo info = (ProcessInfo)iter.next();
        System.err.println(info.getPid() + " " + info.getName());
      }
      System.err.println("Trying to attach...");
      debugger.attach(pid);
      System.err.println("Attach succeeded.");
      System.err.println("Trying to detach...");
      if (!debugger.detach())
      {
        System.err.println("ERROR: detach failed.");
        System.exit(0);
      }
      System.err.println("Detach succeeded.");
    }
    catch (Exception e)
    {
      e.printStackTrace();
    }
  }
}

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

import java.io.PrintStream;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.JVMDebugger;
import sun.jvm.hotspot.debugger.MachineDescriptionIntelX86;

public class TestHelloWorld
{
  private static void usage()
  {
    System.out.println("usage: java TestHelloWorld [pid]");
    System.out.println("pid must be the process ID of the HelloWorldDLL programs");
    System.exit(1);
  }
  
  public static void main(String[] args)
  {
    try
    {
      if (args.length != 1) {
        usage();
      }
      int pid = 0;
      try
      {
        pid = Integer.parseInt(args[0]);
      }
      catch (NumberFormatException e)
      {
        usage();
      }
      JVMDebugger debugger = new Win32DebuggerLocal(new MachineDescriptionIntelX86(), true);
      System.err.println("Trying to attach...");
      debugger.attach(pid);
      System.err.println("Attach succeeded.");
      Address addr = debugger.lookup("helloworld.dll", "helloWorldString");
      System.err.println("helloWorldString address = " + addr);
      System.err.println("Trying to detach...");
      if (!debugger.detach())
      {
        System.err.println("ERROR: detach failed.");
        System.exit(0);
      }
      System.err.println("Detach succeeded.");
    }
    catch (Exception e)
    {
      e.printStackTrace();
    }
  }
}

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

import java.io.PrintStream;
import sun.jvm.hotspot.debugger.Address;
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 Win32Address
  implements Address
{
  protected Win32Debugger debugger;
  protected long addr;
  
  Win32Address(Win32Debugger debugger, long addr)
  {
    this.debugger = debugger;
    this.addr = addr;
  }
  
  public boolean equals(Object arg)
  {
    if (arg == null) {
      return false;
    }
    if (!(arg instanceof Win32Address)) {
      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)
  {
    debugger.writeCInteger(addr + offset, numBytes, value);
  }
  
  public void setAddressAt(long offset, Address value)
  {
    debugger.writeAddress(addr + offset, (Win32Address)value);
  }
  
  public void setJBooleanAt(long offset, boolean value)
    throws UnmappedAddressException, UnalignedAddressException
  {
    debugger.writeJBoolean(addr + offset, value);
  }
  
  public void setJByteAt(long offset, byte value)
    throws UnmappedAddressException, UnalignedAddressException
  {
    debugger.writeJByte(addr + offset, value);
  }
  
  public void setJCharAt(long offset, char value)
    throws UnmappedAddressException, UnalignedAddressException
  {
    debugger.writeJChar(addr + offset, value);
  }
  
  public void setJDoubleAt(long offset, double value)
    throws UnmappedAddressException, UnalignedAddressException
  {
    debugger.writeJDouble(addr + offset, value);
  }
  
  public void setJFloatAt(long offset, float value)
    throws UnmappedAddressException, UnalignedAddressException
  {
    debugger.writeJFloat(addr + offset, value);
  }
  
  public void setJIntAt(long offset, int value)
    throws UnmappedAddressException, UnalignedAddressException
  {
    debugger.writeJInt(addr + offset, value);
  }
  
  public void setJLongAt(long offset, long value)
    throws UnmappedAddressException, UnalignedAddressException
  {
    debugger.writeJLong(addr + offset, value);
  }
  
  public void setJShortAt(long offset, short value)
    throws UnmappedAddressException, UnalignedAddressException
  {
    debugger.writeJShort(addr + offset, value);
  }
  
  public void setOopHandleAt(long offset, OopHandle value)
    throws UnmappedAddressException, UnalignedAddressException
  {
    debugger.writeOopHandle(addr + offset, (Win32OopHandle)value);
  }
  
  public Address addOffsetTo(long offset)
    throws UnsupportedOperationException
  {
    long value = addr + offset;
    if (value == 0L) {
      return null;
    }
    return new Win32Address(debugger, value);
  }
  
  public OopHandle addOffsetToAsOopHandle(long offset)
    throws UnsupportedOperationException
  {
    long value = addr + offset;
    if (value == 0L) {
      return null;
    }
    return new Win32OopHandle(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;
    }
    Win32Address arg = (Win32Address)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;
    }
    Win32Address arg = (Win32Address)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;
    }
    Win32Address arg = (Win32Address)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;
    }
    Win32Address arg = (Win32Address)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 Win32Address(debugger, value);
  }
  
  public Address orWithMask(long mask)
    throws UnsupportedOperationException
  {
    long value = addr | mask;
    if (value == 0L) {
      return null;
    }
    return new Win32Address(debugger, value);
  }
  
  public Address xorWithMask(long mask)
    throws UnsupportedOperationException
  {
    long value = addr ^ mask;
    if (value == 0L) {
      return null;
    }
    return new Win32Address(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)
  {
    Win32Address p1 = new Win32Address(null, 9223372036854775792L);
    Win32Address p2 = (Win32Address)p1.addOffsetTo(10L);
    Win32Address n1 = (Win32Address)p2.addOffsetTo(10L);
    Win32Address n2 = (Win32Address)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");
    c
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