sa-jdi

                   out.println("<RuntimeStub>");
                  }
                  else if (cb.isDeoptimizationStub())
                  {
                    out.println("<DeoptimizationStub>");
                  }
                  else if (cb.isUncommonTrapStub())
                  {
                    out.println("<UncommonTrap>");
                  }
                  else if (cb.isExceptionStub())
                  {
                    out.println("<ExceptionStub>");
                  }
                  else if (cb.isSafepointStub())
                  {
                    out.println("<SafepointStub>");
                  }
                  else
                  {
                    out.println("<Unknown code blob>");
                  }
                }
                else
                {
                  printUnknown(out);
                }
              }
              if ((names != null) && (names.length != 0)) {
                for (int i = 0; i < names.length; i++) {
                  out.println(names[i]);
                }
              }
            }
            else
            {
              printUnknown(out);
            }
            f = f.sender(th);
          }
        }
        catch (Exception exp)
        {
          exp.printStackTrace();
        }
        if ((isJava) && (concurrentLocks))
        {
          JavaThread jthread = (JavaThread)proxyToThread.get(th);
          if (jthread != null) {
            concLocksPrinter.print(jthread, out);
          }
        }
      }
    }
    else if (getDebugeeType() == 2)
    {
      out.println("remote configuration is not yet implemented");
    }
    else
    {
      out.println("not yet implemented (debugger does not support CDebugger)!");
    }
  }
  
  protected boolean requiresVM()
  {
    return false;
  }
  
  public static void main(String[] args)
    throws Exception
  {
    PStack t = new PStack();
    t.start(args);
    t.stop();
  }
  
  private void initJFrameCache()
  {
    jframeCache = new HashMap();
    proxyToThread = new HashMap();
    Threads threads = VM.getVM().getThreads();
    for (JavaThread cur = threads.first(); cur != null; cur = cur.next())
    {
      List tmp = new ArrayList(10);
      try
      {
        for (JavaVFrame vf = cur.getLastJavaVFrameDbg(); vf != null; vf = vf.javaSender()) {
          tmp.add(vf);
        }
      }
      catch (Exception exp)
      {
        exp.printStackTrace();
      }
      JavaVFrame[] jvframes = new JavaVFrame[tmp.size()];
      System.arraycopy(tmp.toArray(), 0, jvframes, 0, jvframes.length);
      jframeCache.put(cur.getThreadProxy(), jvframes);
      proxyToThread.put(cur.getThreadProxy(), cur);
    }
  }
  
  private void printUnknown(PrintStream out)
  {
    out.println("\t????????");
  }
  
  private String[] getJavaNames(ThreadProxy th, Address fp)
  {
    if (fp == null) {
      return null;
    }
    JavaVFrame[] jvframes = (JavaVFrame[])jframeCache.get(th);
    if (jvframes == null) {
      return null;
    }
    List names = new ArrayList(10);
    for (int fCount = 0; fCount < jvframes.length; fCount++)
    {
      JavaVFrame vf = jvframes[fCount];
      Frame f = vf.getFrame();
      if (fp.equals(f.getFP()))
      {
        StringBuffer sb = new StringBuffer();
        Method method = vf.getMethod();
        
        sb.append("* ");
        sb.append(method.externalNameAndSignature());
        sb.append(" bci:" + vf.getBCI());
        int lineNumber = method.getLineNumberFromBCI(vf.getBCI());
        if (lineNumber != -1) {
          sb.append(" line:" + lineNumber);
        }
        if (verbose) {
          sb.append(" methodOop:" + method.getHandle());
        }
        if (vf.isCompiledFrame())
        {
          sb.append(" (Compiled frame");
          if (vf.isDeoptimized()) {
            sb.append(" [deoptimized]");
          }
        }
        else if (vf.isInterpretedFrame())
        {
          sb.append(" (Interpreted frame");
        }
        if (vf.mayBeImpreciseDbg()) {
          sb.append("; information may be imprecise");
        }
        sb.append(")");
        names.add(sb.toString());
      }
    }
    String[] res = new String[names.size()];
    System.arraycopy(names.toArray(), 0, res, 0, res.length);
    return res;
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.tools.PStack
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.tools.soql;

import sun.jvm.hotspot.utilities.ObjectReader;
import sun.jvm.hotspot.utilities.soql.JSJavaFactory;
import sun.jvm.hotspot.utilities.soql.JSJavaFactoryImpl;
import sun.jvm.hotspot.utilities.soql.JSJavaScriptEngine;

final class JSDB$1
  extends JSJavaScriptEngine
{
  private ObjectReader objReader = new ObjectReader();
  private JSJavaFactory factory = new JSJavaFactoryImpl();
  private final JSDB this$0;
  
  JSDB$1(JSDB paramJSDB) {}
  
  public ObjectReader getObjectReader()
  {
    return objReader;
  }
  
  public JSJavaFactory getJSJavaFactory()
  {
    return factory;
  }
}

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

import sun.jvm.hotspot.tools.Tool;
import sun.jvm.hotspot.utilities.ObjectReader;
import sun.jvm.hotspot.utilities.soql.JSJavaFactory;
import sun.jvm.hotspot.utilities.soql.JSJavaFactoryImpl;
import sun.jvm.hotspot.utilities.soql.JSJavaScriptEngine;

public class JSDB
  extends Tool
{
  public static void main(String[] args)
  {
    JSDB jsdb = new JSDB();
    jsdb.start(args);
    jsdb.stop();
  }
  
  public void run()
  {
    JSJavaScriptEngine engine = new JSJavaScriptEngine()
    {
      private ObjectReader objReader = new ObjectReader();
      private JSJavaFactory factory = new JSJavaFactoryImpl();
      
      public ObjectReader getObjectReader()
      {
        return objReader;
      }
      
      public JSJavaFactory getJSJavaFactory()
      {
        return factory;
      }
    };
    engine.startConsole();
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.tools.soql.JSDB
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.tools.soql;

import java.io.PrintStream;
import sun.jvm.hotspot.oops.Oop;
import sun.jvm.hotspot.utilities.soql.JSJavaObject;
import sun.jvm.hotspot.utilities.soql.ObjectVisitor;

final class SOQL$1
  implements ObjectVisitor
{
  private final SOQL this$0;
  
  SOQL$1(SOQL paramSOQL) {}
  
  public void visit(Object o)
  {
    if ((o != null) && ((o instanceof JSJavaObject)))
    {
      String oopAddr = ((JSJavaObject)o).getOop().getHandle().toString();
      this$0.out.println(oopAddr);
    }
    else
    {
      this$0.out.println(o == null ? "null" : o.toString());
    }
  }
}

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

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.util.StringTokenizer;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.Debugger;
import sun.jvm.hotspot.debugger.OopHandle;
import sun.jvm.hotspot.oops.ConstantPool;
import sun.jvm.hotspot.oops.InstanceKlass;
import sun.jvm.hotspot.oops.ObjectHeap;
import sun.jvm.hotspot.oops.Oop;
import sun.jvm.hotspot.oops.OopPrinter;
import sun.jvm.hotspot.oops.Symbol;
import sun.jvm.hotspot.oops.TypeArray;
import sun.jvm.hotspot.runtime.SignatureConverter;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.tools.Tool;
import sun.jvm.hotspot.utilities.SystemDictionaryHelper;
import sun.jvm.hotspot.utilities.soql.JSJavaObject;
import sun.jvm.hotspot.utilities.soql.ObjectVisitor;
import sun.jvm.hotspot.utilities.soql.SOQLEngine;
import sun.jvm.hotspot.utilities.soql.SOQLException;

public class SOQL
  extends Tool
{
  protected SOQLEngine soqlEngine;
  
  public static void main(String[] args)
  {
    SOQL soql = new SOQL();
    soql.start(args);
    soql.stop();
  }
  
  protected BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
  protected PrintStream out = System.out;
  protected static String prompt = "soql> ";
  protected static String secondPrompt = "> ";
  
  public void run()
  {
    soqlEngine = SOQLEngine.getEngine();
    try
    {
      for (;;)
      {
        out.print(prompt);
        String line = in.readLine();
        if (line == null) {
          return;
        }
        StringTokenizer st = new StringTokenizer(line);
        if (st.hasMoreTokens())
        {
          String cmd = st.nextToken();
          if (cmd.equals("select"))
          {
            handleSelect(line);
          }
          else if (cmd.equals("classes"))
          {
            handleClasses(line);
          }
          else if (cmd.equals("class"))
          {
            handleClass(line);
          }
          else if (cmd.equals("object"))
          {
            handleObject(line);
          }
          else
          {
            if (cmd.equals("quit"))
            {
              out.println("Bye!");
              return;
            }
            if (!cmd.equals("")) {
              handleUnknown(line);
            }
          }
        }
      }
      return;
    }
    catch (IOException e)
    {
      e.printStackTrace();
    }
  }
  
  protected void handleSelect(String query)
  {
    StringBuffer buf = new StringBuffer(query);
    String tmp = null;
    for (;;)
    {
      out.print(secondPrompt);
      try
      {
        tmp = in.readLine();
      }
      catch (IOException ioe)
      {
        break;
      }
      if ((tmp.equals("")) || (tmp.equals("go"))) {
        break;
      }
      buf.append('\n');
      buf.append(tmp);
    }
    query = buf.toString();
    try
    {
      soqlEngine.executeQuery(query, new ObjectVisitor()
      {
        public void visit(Object o)
        {
          if ((o != null) && ((o instanceof JSJavaObject)))
          {
            String oopAddr = ((JSJavaObject)o).getOop().getHandle().toString();
            out.println(oopAddr);
          }
          else
          {
            out.println(o == null ? "null" : o.toString());
          }
        }
      });
    }
    catch (SOQLException se)
    {
      se.printStackTrace();
    }
  }
  
  protected void handleClasses(String line)
  {
    InstanceKlass[] klasses = SystemDictionaryHelper.getAllInstanceKlasses();
    for (int i = 0; i < klasses.length; i++)
    {
      out.print(klasses[i].getName().asString().replace('/', '.'));
      out.print(" @");
      out.println(klasses[i].getHandle());
    }
  }
  
  protected void handleClass(String line)
  {
    StringTokenizer st = new StringTokenizer(line);
    st.nextToken();
    if (st.hasMoreTokens())
    {
      String className = st.nextToken();
      InstanceKlass klass = SystemDictionaryHelper.findInstanceKlass(className);
      if (klass == null)
      {
        out.println("class " + className + " not found");
      }
      else
      {
        InstanceKlass base = (InstanceKlass)klass.getSuper();
        if (base != null)
        {
          out.println("super");
          out.print("\t");
          out.println(base.getName().asString().replace('/', '.'));
        }
        TypeArray fields = klass.getFields();
        int numFields = (int)fields.getLength();
        ConstantPool cp = klass.getConstants();
        out.println("fields");
        if (numFields != 0) {
          for (int f = 0; f < numFields; f += InstanceKlass.NEXT_OFFSET)
          {
            int nameIndex = fields.getShortAt(f + InstanceKlass.NAME_INDEX_OFFSET);
            int sigIndex = fields.getShortAt(f + InstanceKlass.SIGNATURE_INDEX_OFFSET);
            Symbol f_name = cp.getSymbolAt(nameIndex);
            Symbol f_sig = cp.getSymbolAt(sigIndex);
            StringBuffer sigBuf = new StringBuffer();
            new SignatureConverter(f_sig, sigBuf).dispatchField();
            out.print('\t');
            out.print(sigBuf.toString().replace('/', '.'));
            out.print(' ');
            out.println(f_name.asString());
          }
        } else {
          out.println("\tno fields in this class");
        }
      }
    }
    else
    {
      out.println("usage: class <name of the class>");
    }
  }
  
  protected Oop getOopAtAddress(Address addr)
  {
    OopHandle oopHandle = addr.addOffsetToAsOopHandle(0L);
    return VM.getVM().getObjectHeap().newOop(oopHandle);
  }
  
  protected void handleObject(String line)
  {
    StringTokenizer st = new StringTokenizer(line);
    st.nextToken();
    if (st.hasMoreTokens())
    {
      String addrStr = st.nextToken();
      Address addr = null;
      Debugger dbg = VM.getVM().getDebugger();
      try
      {
        addr = dbg.parseAddress(addrStr);
      }
      catch (Exception e)
      {
        out.println("invalid address : " + e.getMessage());
        return;
      }
      Oop oop = null;
      try
      {
        oop = getOopAtAddress(addr);
      }
      catch (Exception e)
      {
        out.println("invalid object : " + e.getMessage());
      }
      if (oop != null) {
        oop.iterate(new OopPrinter(out), true);
      } else {
        out.println("null object!");
      }
    }
    else
    {
      out.println("usage: object <address>");
    }
  }
  
  protected void handleUnknown(String line)
  {
    out.println("Unknown command!");
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.tools.soql.SOQL
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.tools;

import java.io.PrintStream;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.AddressException;
import sun.jvm.hotspot.oops.Method;
import sun.jvm.hotspot.runtime.ConcurrentLocksPrinter;
import sun.jvm.hotspot.runtime.DeadlockDetector;
import sun.jvm.hotspot.runtime.Frame;
import sun.jvm.hotspot.runtime.JavaThread;
import sun.jvm.hotspot.runtime.JavaVFrame;
import sun.jvm.hotspot.runtime.Threads;
import sun.jvm.hotspot.runtime.VM;

public class StackTrace
  extends Tool
{
  private boolean verbose;
  private boolean concurrentLocks;
  
  public StackTrace(boolean v, boolean concurrentLocks)
  {
    verbose = v;
    this.concurrentLocks = concurrentLocks;
  }
  
  public StackTrace()
  {
    this(true, true);
  }
  
  public void run()
  {
    run(System.out);
  }
  
  public void run(PrintStream tty)
  {
    try
    {
      DeadlockDetector.print(tty);
    }
    catch (Exception exp)
    {
      exp.printStackTrace();
      tty.println("Can't print deadlocks:" + exp.getMessage());
    }
    try
    {
      ConcurrentLocksPrinter concLocksPrinter = null;
      if (concurrentLocks) {
        concLocksPrinter = new ConcurrentLocksPrinter();
      }
      Threads threads = VM.getVM().getThreads();
      int i = 1;
      for (JavaThread cur = threads.first(); cur != null; i++)
      {
        if (cur.isJavaThread())
        {
          Address sp = cur.getLastJavaSP();
          tty.print("Thread ");
          cur.printThreadIDOn(tty);
          tty.print(": (state = " + cur.getThreadState());
          if (verbose) {
            tty.println(", current Java SP = " + sp);
          }
          tty.println(')');
          try
          {
            for (JavaVFrame vf = cur.getLastJavaVFrameDbg(); vf != null; vf = vf.javaSender())
            {
              Method method = vf.getMethod();
              tty.print(" - " + method.externalNameAndSignature() + " @bci=" + vf.getBCI());
              
              int lineNumber = method.getLineNumberFromBCI(vf.getBCI());
              if (lineNumber != -1) {
                tty.print(", line=" + lineNumber);
              }
              if (verbose)
              {
                Address pc = vf.getFrame().getPC();
                if (pc != null) {
                  tty.print(", pc=" + pc);
                }
                tty.print(", methodOop=" + method.getHandle());
              }
              if (vf.isCompiledFrame())
              {
                tty.print(" (Compiled frame");
                if (vf.isDeoptimized()) {
                  tty.print(" [deoptimized]");
                }
              }
              if (vf.isInterpretedFrame()) {
                tty.print(" (Interpreted frame");
              }
              if (vf.mayBeImpreciseDbg()) {
                tty.print("; information may be imprecise");
              }
              tty.println(")");
            }
          }
          catch (Exception e)
          {
            tty.println("Error occurred during stack walking:");
            e.printStackTrace();
          }
          tty.println();
          if (concurrentLocks) {
            concLocksPrinter.print(cur, tty);
          }
          tty.println();
        }
        cur = cur.next();
      }
    }
    catch (AddressException e)
    {
      System.err.println("Error accessing address 0x" + Long.toHexString(e.getAddress()));
      e.printStackTrace();
    }
  }
  
  public static void main(String[] args)
  {
    StackTrace st = new StackTrace();
    st.start(args);
    st.stop();
  }
}

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

import java.io.PrintStream;
import java.util.Enumeration;
import java.util.Properties;
import sun.jvm.hotspot.runtime.VM;

public class SysPropsDumper
  extends Tool
{
  public void run()
  {
    Properties sysProps = VM.getVM().getSystemProperties();
    PrintStream out = System.out;
    if (sysProps != null)
    {
      Enumeration keys = sysProps.keys();
      while (keys.hasMoreElements())
      {
        Object key = keys.nextElement();
        out.print(key);
        out.print(" = ");
        out.println(sysProps.get(key));
      }
    }
    else
    {
      out.println("System Properties info not available!");
    }
  }
  
  public static void main(String[] args)
  {
    SysPropsDumper pd = new SysPropsDumper();
    pd.start(args);
    pd.stop();
  }
}

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

import java.io.PrintStream;
import sun.jvm.hotspot.bugspot.BugSpotAgent;
import sun.jvm.hotspot.debugger.DebuggerException;
import sun.jvm.hotspot.runtime.VM;

public abstract class Tool
  implements Runnable
{
  private BugSpotAgent agent;
  private int debugeeType;
  protected static final int DEBUGEE_PID = 0;
  protected static final int DEBUGEE_CORE = 1;
  protected static final int DEBUGEE_REMOTE = 2;
  
  public String getName()
  {
    return getClass().getName();
  }
  
  protected boolean needsJavaPrefix()
  {
    return true;
  }
  
  protected boolean requiresVM()
  {
    return true;
  }
  
  protected void setAgent(BugSpotAgent a)
  {
    agent = a;
  }
  
  protected void setDebugeeType(int dt)
  {
    debugeeType = dt;
  }
  
  protected BugSpotAgent getAgent()
  {
    return agent;
  }
  
  protected int getDebugeeType()
  {
    return debugeeType;
  }
  
  protected void printUsage()
  {
    String name = null;
    if (needsJavaPrefix()) {
      name = "java " + getName();
    } else {
      name = getName();
    }
    System.out.println("Usage: " + name + " [option] <pid>");
    System.out.println("\t\t(to connect to a live java process)");
    System.out.println("   or " + name + " [option] <executable> <core>");
    System.out.println("\t\t(to connect to a core file)");
    System.out.println("   or " + name + " [option] [server_id@]<remote server IP or hostname>");
    System.out.println("\t\t(to connect to a remote debug server)");
    System.out.println();
    System.out.println("where option must be one of:");
    printFlagsUsage();
  }
  
  protected void printFlagsUsage()
  {
    System.out.println("    -h | -help\tto print this help message");
  }
  
  protected void usage()
  {
    printUsage();
    System.exit(1);
  }
  
  protected void stop()
  {
    if (agent != null)
    {
      agent.detach();
      System.exit(0);
    }
  }
  
  protected void start(String[] args)
  {
    if ((args.length < 1) || (args.length > 2)) {
      usage();
    }
    if (args[0].startsWith("-")) {
      usage();
    }
    PrintStream err = System.err;
    
    int pid = 0;
    String coreFileName = null;
    String executableName = null;
    String remoteServer = null;
    switch (args.length)
    {
    case 1: 
      try
      {
        pid = Integer.parseInt(args[0]);
        debugeeType = 0;
      }
      catch (NumberFormatException e)
      {
        remoteServer = args[0];
        debugeeType = 2;
      }
    case 2: 
      executableName = args[0];
      coreFileName = args[1];
      debugeeType = 1;
      break;
    default: 
      usage();
    }
    agent = new BugSpotAgent();
    try
    {
      switch (debugeeType)
      {
      case 0: 
        err.println("Attaching to process ID " + pid + ", please wait...");
        agent.attach(pid);
        break;
      case 1: 
        err.println("Attaching to core " + coreFileName + " from executable " + executableName + ", please wait...");
        
        agent.attach(executableName, coreFileName);
        break;
      case 2: 
        err.println("Attaching to remote server " + remoteServer + ", please wait...");
        agent.attach(remoteServer);
      }
    }
    catch (DebuggerException e)
    {
      switch (debugeeType)
      {
      case 0: 
        err.print("Error attaching to process: ");
        break;
      case 1: 
        err.print("Error attaching to core file: ");
        break;
      case 2: 
        err.print("Error attaching to remote server: ");
      }
      if (e.getMessage() != null) {
        err.print(e.getMessage());
      }
      err.println();
      System.exit(1);
    }
    err.println("Debugger attached successfully.");
    
    boolean isJava = agent.isJavaMode();
    if (isJava)
    {
      VM vm = VM.getVM();
      if (vm.isCore()) {
        err.println("Core build detected.");
      } else if (vm.isClientCompiler()) {
        err.println("Client compiler detected.");
      } else if (vm.isServerCompiler()) {
        err.println("Server compiler detected.");
      } else {
        throw new RuntimeException("Fatal error: should have been able to detect core/C1/C2 build");
      }
      String version = vm.getVMRelease();
      if (version != null)
      {
        err.print("JVM version is ");
        err.println(version);
      }
      run();
    }
    else if (requiresVM())
    {
      err.println(getName() + " requires a java VM process/core!");
    }
    else
    {
      run();
    }
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.tools.Tool
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.types;

import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.UnalignedAddressException;
import sun.jvm.hotspot.debugger.UnmappedAddressException;

public abstract interface AddressField
  extends Field
{
  public abstract Address getValue(Address paramAddress)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException;
  
  public abstract Address getValue()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException;
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.types.AddressField
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.types.basic;

import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.UnalignedAddressException;
import sun.jvm.hotspot.debugger.UnmappedAddressException;
import sun.jvm.hotspot.types.AddressField;
import sun.jvm.hotspot.types.Field;
import sun.jvm.hotspot.types.WrongTypeException;

public class BasicAddressFieldWrapper
  extends BasicFieldWrapper
  implements AddressField
{
  public BasicAddressFieldWrapper(Field field)
  {
    super(field);
  }
  
  public Address getValue(Address addr)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    return field.getAddress(addr);
  }
  
  public Address getValue()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    return field.getAddress();
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.types.basic.BasicAddressFieldWrapper
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.types.basic;

import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.UnalignedAddressException;
import sun.jvm.hotspot.debugger.UnmappedAddressException;
import sun.jvm.hotspot.types.CIntegerField;
import sun.jvm.hotspot.types.CIntegerType;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.WrongTypeException;

public class BasicCIntegerField
  extends BasicField
  implements CIntegerField
{
  private CIntegerType intType;
  
  public BasicCIntegerField(BasicTypeDataBase db, Type containingType, String name, Type type, boolean isStatic, long offset, Address staticFieldAddress)
  {
    super(db, containingType, name, type, isStatic, offset, staticFieldAddress);
    if (!(type instanceof CIntegerType)) {
      throw new WrongTypeException("Type of a BasicCIntegerField must be a CIntegerType");
    }
    intType = ((CIntegerType)type);
  }
  
  public boolean isUnsigned()
  {
    return intType.isUnsigned();
  }
  
  public long getValue(Address addr)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    return getCInteger(addr, intType);
  }
  
  public long getValue()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    return getCInteger(intType);
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.types.basic.BasicCIntegerField
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.types.basic;

import sun.jvm.hotspot.types.CIntegerType;

public class BasicCIntegerType
  extends BasicType
  implements CIntegerType
{
  private boolean isUnsigned;
  
  public BasicCIntegerType(BasicTypeDataBase db, String name, boolean isUnsigned)
  {
    super(db, name, null);
    
    this.isUnsigned = isUnsigned;
  }
  
  public boolean equals(Object obj)
  {
    if (!super.equals(obj)) {
      return false;
    }
    if (!(obj instanceof BasicCIntegerType)) {
      return false;
    }
    BasicCIntegerType arg = (BasicCIntegerType)obj;
    if (isUnsigned != isUnsigned) {
      return false;
    }
    return true;
  }
  
  public String toString()
  {
    String prefix = null;
    if (isUnsigned) {
      prefix = "unsigned";
    }
    if (prefix != null) {
      return prefix + " " + getName();
    }
    return getName();
  }
  
  public boolean isCIntegerType()
  {
    return true;
  }
  
  public boolean isUnsigned()
  {
    return isUnsigned;
  }
  
  public void setIsUnsigned(boolean isUnsigned)
  {
    this.isUnsigned = isUnsigned;
  }
  
  public long maxValue()
  {
    return db.cIntegerTypeMaxValue(getSize(), isUnsigned());
  }
  
  public long minValue()
  {
    return db.cIntegerTypeMinValue(getSize(), isUnsigned());
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.types.basic.BasicCIntegerType
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.types.basic;

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;
import sun.jvm.hotspot.types.CIntegerType;
import sun.jvm.hotspot.types.Field;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.WrongTypeException;

public class BasicField
  implements Field
{
  protected BasicTypeDataBase db;
  protected Type type;
  private Type containingType;
  private String name;
  private long size;
  private boolean isStatic;
  private long offset;
  private Address staticFieldAddress;
  
  public BasicField(Field fld)
  {
    BasicField field = (BasicField)fld;
    
    db = db;
    containingType = containingType;
    name = name;
    type = type;
    size = size;
    isStatic = isStatic;
    offset = offset;
    staticFieldAddress = staticFieldAddress;
  }
  
  public BasicField(BasicTypeDataBase db, Type containingType, String name, Type type, boolean isStatic, long offsetInBytes, Address staticFieldAddress)
  {
    this.db = db;
    this.containingType = containingType;
    this.name = name;
    this.type = type;
    size = type.getSize();
    this.isStatic = isStatic;
    offset = offsetInBytes;
    this.staticFieldAddress = staticFieldAddress;
  }
  
  public String getName()
  {
    return name;
  }
  
  public Type getType()
  {
    return type;
  }
  
  public long getSize()
  {
    return size;
  }
  
  public boolean isStatic()
  {
    return isStatic;
  }
  
  public long getOffset()
    throws WrongTypeException
  {
    if (isStatic) {
      throw new WrongTypeException("field \"" + name + "\" in class " + containingType.getName() + " is static");
    }
    return offset;
  }
  
  public Address getStaticFieldAddress()
    throws WrongTypeException
  {
    if (!isStatic) {
      throw new WrongTypeException("field \"" + name + "\" in class " + containingType.getName() + " is not static");
    }
    return staticFieldAddress;
  }
  
  public boolean getJBoolean(Address addr)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    if (isStatic) {
      throw new WrongTypeException();
    }
    return addr.getJBooleanAt(offset);
  }
  
  public byte getJByte(Address addr)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    if (isStatic) {
      throw new WrongTypeException();
    }
    return addr.getJByteAt(offset);
  }
  
  public char getJChar(Address addr)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    if (isStatic) {
      throw new WrongTypeException();
    }
    return addr.getJCharAt(offset);
  }
  
  public double getJDouble(Address addr)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    if (isStatic) {
      throw new WrongTypeException();
    }
    return addr.getJDoubleAt(offset);
  }
  
  public float getJFloat(Address addr)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    if (isStatic) {
      throw new WrongTypeException();
    }
    return addr.getJFloatAt(offset);
  }
  
  public int getJInt(Address addr)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    if (isStatic) {
      throw new WrongTypeException();
    }
    return addr.getJIntAt(offset);
  }
  
  public long getJLong(Address addr)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    if (isStatic) {
      throw new WrongTypeException();
    }
    return addr.getJLongAt(offset);
  }
  
  public short getJShort(Address addr)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    if (isStatic) {
      throw new WrongTypeException();
    }
    return addr.getJShortAt(offset);
  }
  
  public long getCInteger(Address addr, CIntegerType type)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    if (isStatic) {
      throw new WrongTypeException();
    }
    return addr.getCIntegerAt(offset, type.getSize(), type.isUnsigned());
  }
  
  public Address getAddress(Address addr)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    if (isStatic) {
      throw new WrongTypeException();
    }
    return addr.getAddressAt(offset);
  }
  
  public OopHandle getOopHandle(Address addr)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException, NotInHeapException
  {
    if (isStatic) {
      throw new WrongTypeException();
    }
    return addr.getOopHandleAt(offset);
  }
  
  public OopHandle getNarrowOopHandle(Address addr)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException, NotInHeapException
  {
    if (isStatic) {
      throw new WrongTypeException();
    }
    return addr.getCompOopHandleAt(offset);
  }
  
  public boolean getJBoolean()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    if (!isStatic) {
      throw new WrongTypeException();
    }
    return staticFieldAddress.getJBooleanAt(0L);
  }
  
  public byte getJByte()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    if (!isStatic) {
      throw new WrongTypeException();
    }
    return staticFieldAddress.getJByteAt(0L);
  }
  
  public char getJChar()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    if (!isStatic) {
      throw new WrongTypeException();
    }
    return staticFieldAddress.getJCharAt(0L);
  }
  
  public double getJDouble()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    if (!isStatic) {
      throw new WrongTypeException();
    }
    return staticFieldAddress.getJDoubleAt(0L);
  }
  
  public float getJFloat()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    if (!isStatic) {
      throw new WrongTypeException();
    }
    return staticFieldAddress.getJFloatAt(0L);
  }
  
  public int getJInt()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    if (!isStatic) {
      throw new WrongTypeException();
    }
    return staticFieldAddress.getJIntAt(0L);
  }
  
  public long getJLong()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    if (!isStatic) {
      throw new WrongTypeException();
    }
    return staticFieldAddress.getJLongAt(0L);
  }
  
  public short getJShort()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    if (!isStatic) {
      throw new WrongTypeException();
    }
    return staticFieldAddress.getJShortAt(0L);
  }
  
  public long getCInteger(CIntegerType type)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    if (!isStatic) {
      throw new WrongTypeException();
    }
    return staticFieldAddress.getCIntegerAt(0L, type.getSize(), type.isUnsigned());
  }
  
  public Address getAddress()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    if (!isStatic) {
      throw new WrongTypeException();
    }
    return staticFieldAddress.getAddressAt(0L);
  }
  
  public OopHandle getOopHandle()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException, NotInHeapException
  {
    if (!isStatic) {
      throw new WrongTypeException();
    }
    return staticFieldAddress.getOopHandleAt(0L);
  }
  
  public OopHandle getNarrowOopHandle()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException, NotInHeapException
  {
    if (!isStatic) {
      throw new WrongTypeException();
    }
    return staticFieldAddress.getCompOopHandleAt(0L);
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.types.basic.BasicField
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.types.basic;

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;
import sun.jvm.hotspot.types.CIntegerType;
import sun.jvm.hotspot.types.Field;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.WrongTypeException;

public class BasicFieldWrapper
  implements Field
{
  protected Field field;
  
  public BasicFieldWrapper(Field field)
  {
    this.field = field;
  }
  
  public String getName()
  {
    return field.getName();
  }
  
  public Type getType()
  {
    return field.getType();
  }
  
  public long getSize()
  {
    return field.getSize();
  }
  
  public boolean isStatic()
  {
    return field.isStatic();
  }
  
  public long getOffset()
    throws WrongTypeException
  {
    return field.getOffset();
  }
  
  public Address getStaticFieldAddress()
    throws WrongTypeException
  {
    return field.getStaticFieldAddress();
  }
  
  public boolean getJBoolean(Address addr)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    return field.getJBoolean(addr);
  }
  
  public byte getJByte(Address addr)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    return field.getJByte(addr);
  }
  
  public char getJChar(Address addr)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    return field.getJChar(addr);
  }
  
  public double getJDouble(Address addr)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    return field.getJDouble(addr);
  }
  
  public float getJFloat(Address addr)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    return field.getJFloat(addr);
  }
  
  public int getJInt(Address addr)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    return field.getJInt(addr);
  }
  
  public long getJLong(Address addr)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    return field.getJLong(addr);
  }
  
  public short getJShort(Address addr)
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    return field.getJShort(addr);
  }
  
  public long getCInteger(Address addr, CIntegerType type)
    throws UnmappedAddressException, UnalignedAddressException
  {
    return field.getCInteger(addr, type);
  }
  
  public Address getAddress(Address addr)
    throws UnmappedAddressException, UnalignedAddressException
  {
    return field.getAddress(addr);
  }
  
  public OopHandle getOopHandle(Address addr)
    throws UnmappedAddressException, UnalignedAddressException, NotInHeapException
  {
    return field.getOopHandle(addr);
  }
  
  public OopHandle getNarrowOopHandle(Address addr)
    throws UnmappedAddressException, UnalignedAddressException, NotInHeapException
  {
    return field.getNarrowOopHandle(addr);
  }
  
  public boolean getJBoolean()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    return field.getJBoolean();
  }
  
  public byte getJByte()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    return field.getJByte();
  }
  
  public char getJChar()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    return field.getJChar();
  }
  
  public double getJDouble()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    return field.getJDouble();
  }
  
  public float getJFloat()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    return field.getJFloat();
  }
  
  public int getJInt()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    return field.getJInt();
  }
  
  public long getJLong()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    return field.getJLong();
  }
  
  public short getJShort()
    throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
  {
    return field.getJShort();
  }
  
  public long getCInteger(CIntegerType type)
    throws UnmappedAddressException, UnalignedAddressException
  {
   
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