classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] [PATCH/JDWP] VMVirtualMachine update


From: Keith Seitz
Subject: [cp-patches] [PATCH/JDWP] VMVirtualMachine update
Date: Fri, 02 Sep 2005 13:48:40 -0700
User-agent: Mozilla Thunderbird 1.0.6-1.1.fc4 (X11/20050720)

Hi,

I've committed the attached patch which updates gnu.classpath.jdwp.* for the pending VMVirtualMachine check-in to follow.

Keith

ChangeLog
2005-09-02  Keith Seitz  <address@hidden>

        * gnu/classpath/jdwp/processor/CommandSet.java [vm]: Remove.
        VMVirtualMachine is entirely static.
        * gnu/classpath/jdwp/event/EventManager.java (requestEvent)
        (deleteRequest, clearRequests): Change all VMVirtualMachine calls
        to reflect new API.
        * gnu/classpath/jdwp/processor/ClassLoaderReferenceCommandSet.java
        (executeVisibleClasses): Likewise.
        * gnu/classpath/jdwp/processor/ClassTypeCommandSet.java
        (invokeMethod): Likewise.
        * gnu/classpath/jdwp/processor/MethodCommandSet.java
        (executeLineTable, executeVariableTable): Likewise.
        * gnu/classpath/jdwp/processor/ObjectReferenceCommandSet.java
        (executeInvokeMethod): Likewise.
        * gnu/classpath/jdwp/processor/ReferenceTypeCommandSet.java
        (executeSourceFile, executeStatus): Likewise.
        * gnu/classpath/jdwp/processor/StackFrameCommandSet.java
        (executeGetValues, ,executeSetValues, executeThisObject): Likewise.
        * gnu/classpath/jdwp/processor/ThreadReferenceCommandSet.java
        (executeSuspend, executeResume, executeStatus, executeFrames)
        (executeFrameCount, executeSuspendCount): Likewise.
        * gnu/classpath/jdwp/processor/VirtualMachineCommandSet.java
        (executeClassesBySignature, executeClassesBySignature)
        (executeAllClasses, executeDispose, executeSuspend)
        (executeResume): Likewise.
Index: gnu/classpath/jdwp/processor/ClassLoaderReferenceCommandSet.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/gnu/classpath/jdwp/processor/ClassLoaderReferenceCommandSet.java,v
retrieving revision 1.3
diff -u -p -r1.3 ClassLoaderReferenceCommandSet.java
--- gnu/classpath/jdwp/processor/ClassLoaderReferenceCommandSet.java    25 Aug 
2005 22:09:49 -0000      1.3
+++ gnu/classpath/jdwp/processor/ClassLoaderReferenceCommandSet.java    2 Sep 
2005 20:43:41 -0000
@@ -41,6 +41,7 @@ exception statement from your version. *
 package gnu.classpath.jdwp.processor;
 
 import gnu.classpath.jdwp.JdwpConstants;
+import gnu.classpath.jdwp.VMVirtualMachine;
 import gnu.classpath.jdwp.exception.JdwpException;
 import gnu.classpath.jdwp.exception.JdwpInternalErrorException;
 import gnu.classpath.jdwp.exception.NotImplementedException;
@@ -93,7 +94,7 @@ public class ClassLoaderReferenceCommand
   {
     ObjectId oId = idMan.readObjectId(bb);
     ClassLoader cl = (ClassLoader) oId.getObject();
-    ArrayList loadRequests = vm.getLoadRequests(cl);
+    ArrayList loadRequests = VMVirtualMachine.getLoadRequests(cl);
     os.writeInt(loadRequests.size());
     for (Iterator iter = loadRequests.iterator(); iter.hasNext();)
       {
Index: gnu/classpath/jdwp/processor/ClassTypeCommandSet.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/gnu/classpath/jdwp/processor/ClassTypeCommandSet.java,v
retrieving revision 1.3
diff -u -p -r1.3 ClassTypeCommandSet.java
--- gnu/classpath/jdwp/processor/ClassTypeCommandSet.java       25 Aug 2005 
22:09:49 -0000      1.3
+++ gnu/classpath/jdwp/processor/ClassTypeCommandSet.java       2 Sep 2005 
20:43:41 -0000
@@ -41,6 +41,7 @@ exception statement from your version. *
 package gnu.classpath.jdwp.processor;
 
 import gnu.classpath.jdwp.JdwpConstants;
+import gnu.classpath.jdwp.VMVirtualMachine;
 import gnu.classpath.jdwp.exception.InvalidFieldException;
 import gnu.classpath.jdwp.exception.JdwpException;
 import gnu.classpath.jdwp.exception.JdwpInternalErrorException;
@@ -188,32 +189,29 @@ public class ClassTypeCommandSet
       {
         values[i] = Value.getObj(bb);
       }
-    boolean suspendSuccess = false;
+
     int invokeOpts = bb.getInt();
+    boolean suspend = ((invokeOpts
+                       & JdwpConstants.InvokeOptions.INVOKE_SINGLE_THREADED)
+                      != 0);
     try
       {
-        if ((invokeOpts & JdwpConstants.InvokeOptions.INVOKE_SINGLE_THREADED) 
-            != 0)
-          {
-            // We must suspend all running threads first
-            suspendSuccess = vm.suspendAllThreadsExcept(Thread.currentThread().
-                                                          getThreadGroup());
-          }
-        MethodResult mr = vm.executeMethod(null, thread, clazz, method, values,
-                                           false);
-        if (suspendSuccess)
-          { // We must call resume if we suspended threads
-            suspendSuccess = false;
-            vm.resumeAllThreadsExcept(Thread.currentThread().getThreadGroup());
-          }
+        if (suspend)
+         VMVirtualMachine.suspendAllThreads ();
+
+        MethodResult mr = VMVirtualMachine.executeMethod(null, thread,
+                                                        clazz, method,
+                                                        values, false);
+        if (suspend)
+         VMVirtualMachine.resumeAllThreads ();
+
         return mr;
       }
     catch (Exception ex)
       {
-        if (suspendSuccess)
-          { // We must call resume if we suspended threads
-            vm.resumeAllThreadsExcept(Thread.currentThread().getThreadGroup());
-          }
+        if (suspend)
+         VMVirtualMachine.resumeAllThreads ();
+
         throw new JdwpInternalErrorException(ex);
       }
   }
Index: gnu/classpath/jdwp/processor/CommandSet.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/gnu/classpath/jdwp/processor/CommandSet.java,v
retrieving revision 1.3
diff -u -p -r1.3 CommandSet.java
--- gnu/classpath/jdwp/processor/CommandSet.java        25 Aug 2005 22:09:49 
-0000      1.3
+++ gnu/classpath/jdwp/processor/CommandSet.java        2 Sep 2005 20:43:41 
-0000
@@ -41,7 +41,6 @@ package gnu.classpath.jdwp.processor;
 
 import gnu.classpath.jdwp.exception.JdwpException;
 import gnu.classpath.jdwp.VMIdManager;
-import gnu.classpath.jdwp.VMVirtualMachine;
 
 import java.io.DataOutputStream;
 import java.nio.ByteBuffer;
@@ -58,11 +57,6 @@ public abstract class CommandSet
    * The VM's ID manager
    */
   protected final VMIdManager idMan = VMIdManager.getDefault ();
-
-  /**
-   * The virtual machine description
-   */
-  protected final VMVirtualMachine vm = VMVirtualMachine.getDefault ();
 
   /**
    * Runs the given command with the data in distr and writes the data for the
Index: gnu/classpath/jdwp/processor/MethodCommandSet.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/gnu/classpath/jdwp/processor/MethodCommandSet.java,v
retrieving revision 1.2
diff -u -p -r1.2 MethodCommandSet.java
--- gnu/classpath/jdwp/processor/MethodCommandSet.java  25 Aug 2005 22:09:49 
-0000      1.2
+++ gnu/classpath/jdwp/processor/MethodCommandSet.java  2 Sep 2005 20:43:41 
-0000
@@ -39,6 +39,7 @@ exception statement from your version. *
 package gnu.classpath.jdwp.processor;
 
 import gnu.classpath.jdwp.JdwpConstants;
+import gnu.classpath.jdwp.VMVirtualMachine;
 import gnu.classpath.jdwp.exception.JdwpException;
 import gnu.classpath.jdwp.exception.JdwpInternalErrorException;
 import gnu.classpath.jdwp.exception.NotImplementedException;
@@ -105,7 +106,7 @@ public class MethodCommandSet
     ObjectId oid = idMan.readObjectId(bb);
     Method method = (Method) oid.getObject();
 
-    LineTable lt = vm.getLineTable(clazz, method);
+    LineTable lt = VMVirtualMachine.getLineTable(clazz, method);
     lt.write(os);
   }
 
@@ -118,7 +119,7 @@ public class MethodCommandSet
     ObjectId oid = idMan.readObjectId(bb);
     Method method = (Method) oid.getObject();
 
-    VariableTable vt = vm.getVarTable(clazz, method);
+    VariableTable vt = VMVirtualMachine.getVarTable(clazz, method);
     vt.write(os);
   }
 
Index: gnu/classpath/jdwp/processor/ObjectReferenceCommandSet.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/gnu/classpath/jdwp/processor/ObjectReferenceCommandSet.java,v
retrieving revision 1.4
diff -u -p -r1.4 ObjectReferenceCommandSet.java
--- gnu/classpath/jdwp/processor/ObjectReferenceCommandSet.java 25 Aug 2005 
22:09:49 -0000      1.4
+++ gnu/classpath/jdwp/processor/ObjectReferenceCommandSet.java 2 Sep 2005 
20:43:41 -0000
@@ -40,6 +40,7 @@ exception statement from your version. *
 package gnu.classpath.jdwp.processor;
 
 import gnu.classpath.jdwp.JdwpConstants;
+import gnu.classpath.jdwp.VMVirtualMachine;
 import gnu.classpath.jdwp.exception.InvalidFieldException;
 import gnu.classpath.jdwp.exception.JdwpException;
 import gnu.classpath.jdwp.exception.JdwpInternalErrorException;
@@ -214,18 +215,22 @@ public class ObjectReferenceCommandSet
       }
 
     int invokeOptions = bb.getInt();
+    boolean suspend = ((invokeOptions
+                       & JdwpConstants.InvokeOptions.INVOKE_SINGLE_THREADED)
+                      != 0);
+    if (suspend)
+      {
+       // We must suspend all other running threads first
+        VMVirtualMachine.suspendAllThreads ();
+      }
 
-    if ((invokeOptions & JdwpConstants.InvokeOptions.INVOKE_SINGLE_THREADED) 
!= 0)
-      { // We must suspend all other running threads first
-        vm.suspendAllThreadsExcept(Thread.currentThread().getThreadGroup());
-      }
-    boolean nonVirtual;
-    if ((invokeOptions & JdwpConstants.InvokeOptions.INVOKE_NONVIRTUAL) != 0)
-      nonVirtual = true;
-    else
-      nonVirtual = false;
+    boolean nonVirtual = ((invokeOptions
+                          & JdwpConstants.InvokeOptions.INVOKE_NONVIRTUAL)
+                         != 0);
 
-    MethodResult mr = vm.executeMethod(obj, thread, clazz, method, values, 
nonVirtual);
+    MethodResult mr = VMVirtualMachine.executeMethod(obj, thread,
+                                                    clazz, method,
+                                                    values, nonVirtual);
     Object value = mr.getReturnedValue();
     Exception exception = mr.getThrownException();
 
Index: gnu/classpath/jdwp/processor/ReferenceTypeCommandSet.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/gnu/classpath/jdwp/processor/ReferenceTypeCommandSet.java,v
retrieving revision 1.3
diff -u -p -r1.3 ReferenceTypeCommandSet.java
--- gnu/classpath/jdwp/processor/ReferenceTypeCommandSet.java   25 Aug 2005 
22:09:49 -0000      1.3
+++ gnu/classpath/jdwp/processor/ReferenceTypeCommandSet.java   2 Sep 2005 
20:43:41 -0000
@@ -40,6 +40,7 @@ exception statement from your version. *
 package gnu.classpath.jdwp.processor;
 
 import gnu.classpath.jdwp.JdwpConstants;
+import gnu.classpath.jdwp.VMVirtualMachine;
 import gnu.classpath.jdwp.exception.InvalidFieldException;
 import gnu.classpath.jdwp.exception.JdwpException;
 import gnu.classpath.jdwp.exception.JdwpInternalErrorException;
@@ -241,7 +242,7 @@ public class ReferenceTypeCommandSet
     Class clazz = refId.getType();
 
     // We'll need to go into the jvm for this unless there's an easier way
-    String sourceFileName = vm.getSourceFile(clazz);
+    String sourceFileName = VMVirtualMachine.getSourceFile(clazz);
     JdwpString.writeString(os, sourceFileName);
     // clazz.getProtectionDomain().getCodeSource().getLocation();
   }
@@ -268,7 +269,7 @@ public class ReferenceTypeCommandSet
     Class clazz = refId.getType();
 
     // I don't think there's any other way to get this
-    int status = vm.getStatus(clazz);
+    int status = VMVirtualMachine.getClassStatus(clazz);
     os.writeInt(status);
   }
 
Index: gnu/classpath/jdwp/processor/StackFrameCommandSet.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/gnu/classpath/jdwp/processor/StackFrameCommandSet.java,v
retrieving revision 1.4
diff -u -p -r1.4 StackFrameCommandSet.java
--- gnu/classpath/jdwp/processor/StackFrameCommandSet.java      25 Aug 2005 
22:09:49 -0000      1.4
+++ gnu/classpath/jdwp/processor/StackFrameCommandSet.java      2 Sep 2005 
20:43:41 -0000
@@ -39,8 +39,9 @@ exception statement from your version. *
 
 package gnu.classpath.jdwp.processor;
 
-import gnu.classpath.jdwp.VMFrame;
 import gnu.classpath.jdwp.JdwpConstants;
+import gnu.classpath.jdwp.VMFrame;
+import gnu.classpath.jdwp.VMVirtualMachine;
 import gnu.classpath.jdwp.exception.JdwpException;
 import gnu.classpath.jdwp.exception.JdwpInternalErrorException;
 import gnu.classpath.jdwp.exception.NotImplementedException;
@@ -105,7 +106,7 @@ public class StackFrameCommandSet
     // has a reference to them. Furthermore they are not ReferenceTypeIds since
     // these are held permanently and we want these to be held only as long as
     // the Thread is suspended.
-    VMFrame frame = vm.getVMFrame(thread, bb);
+    VMFrame frame = VMVirtualMachine.getFrame(thread, bb);
     int slots = bb.getInt();
     os.writeInt(slots); // Looks pointless but this is the protocol
     for (int i = 0; i < slots; i++)
@@ -123,7 +124,7 @@ public class StackFrameCommandSet
     ObjectId tId = idMan.readObjectId(bb);
     Thread thread = (Thread) tId.getObject();
 
-    VMFrame frame = vm.getVMFrame(thread, bb);
+    VMFrame frame = VMVirtualMachine.getFrame(thread, bb);
 
     int slots = bb.getInt();
     for (int i = 0; i < slots; i++)
@@ -140,7 +141,7 @@ public class StackFrameCommandSet
     ObjectId tId = idMan.readObjectId(bb);
     Thread thread = (Thread) tId.getObject();
 
-    VMFrame frame = vm.getVMFrame(thread, bb);
+    VMFrame frame = VMVirtualMachine.getFrame(thread, bb);
 
     Object thisObject = frame.getObject();
     Value.writeTaggedValue(os, thisObject);
Index: gnu/classpath/jdwp/processor/ThreadReferenceCommandSet.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/gnu/classpath/jdwp/processor/ThreadReferenceCommandSet.java,v
retrieving revision 1.4
diff -u -p -r1.4 ThreadReferenceCommandSet.java
--- gnu/classpath/jdwp/processor/ThreadReferenceCommandSet.java 25 Aug 2005 
22:09:49 -0000      1.4
+++ gnu/classpath/jdwp/processor/ThreadReferenceCommandSet.java 2 Sep 2005 
20:43:41 -0000
@@ -39,8 +39,9 @@ exception statement from your version. *
 
 package gnu.classpath.jdwp.processor;
 
-import gnu.classpath.jdwp.VMFrame;
 import gnu.classpath.jdwp.JdwpConstants;
+import gnu.classpath.jdwp.VMFrame;
+import gnu.classpath.jdwp.VMVirtualMachine;
 import gnu.classpath.jdwp.exception.InvalidObjectException;
 import gnu.classpath.jdwp.exception.JdwpException;
 import gnu.classpath.jdwp.exception.JdwpInternalErrorException;
@@ -124,7 +125,7 @@ public class ThreadReferenceCommandSet
       throws JdwpException, IOException
   {
     ThreadId tid = (ThreadId) idMan.readObjectId(bb);
-    Thread thread = (Thread) tid.getObject();
+    Thread thread = tid.getThread();
     JdwpString.writeString(os, thread.getName());
   }
 
@@ -132,24 +133,24 @@ public class ThreadReferenceCommandSet
       throws JdwpException, IOException
   {
     ThreadId tid = (ThreadId) idMan.readObjectId(bb);
-    Thread thread = (Thread) tid.getObject();
-    vm.suspendThread(thread);
+    Thread thread = tid.getThread();
+    VMVirtualMachine.suspendThread(thread);
   }
 
   private void executeResume(ByteBuffer bb, DataOutputStream os)
       throws JdwpException, IOException
   {
     ThreadId tid = (ThreadId) idMan.readObjectId(bb);
-    Thread thread = (Thread) tid.getObject();
-    vm.suspendThread(thread);
+    Thread thread = tid.getThread();
+    VMVirtualMachine.suspendThread(thread);
   }
 
   private void executeStatus(ByteBuffer bb, DataOutputStream os)
-      throws InvalidObjectException, IOException
+      throws JdwpException, IOException
   {
     ThreadId tid = (ThreadId) idMan.readObjectId(bb);
-    Thread thread = (Thread) tid.getObject();
-    int threadStatus = vm.getThreadStatus(thread);
+    Thread thread = tid.getThread();
+    int threadStatus = VMVirtualMachine.getThreadStatus(thread);
     // There's only one possible SuspendStatus...
     int suspendStatus = JdwpConstants.SuspendStatus.SUSPENDED;
 
@@ -158,10 +159,10 @@ public class ThreadReferenceCommandSet
   }
 
   private void executeThreadGroup(ByteBuffer bb, DataOutputStream os)
-      throws InvalidObjectException, IOException
+      throws JdwpException, IOException
   {
     ThreadId tid = (ThreadId) idMan.readObjectId(bb);
-    Thread thread = (Thread) tid.getObject();
+    Thread thread = tid.getThread();
     ThreadGroup group = thread.getThreadGroup();
     ObjectId groupId = idMan.getObjectId(group);
     groupId.write(os);
@@ -171,11 +172,11 @@ public class ThreadReferenceCommandSet
       throws JdwpException, IOException
   {
     ThreadId tid = (ThreadId) idMan.readObjectId(bb);
-    Thread thread = (Thread) tid.getObject();
+    Thread thread = tid.getThread();
     int startFrame = bb.getInt();
     int length = bb.getInt();
 
-    ArrayList frames = vm.getVMFrames(thread, startFrame, length);
+    ArrayList frames = VMVirtualMachine.getFrames(thread, startFrame, length);
     os.writeInt(frames.size());
     for (int i = 0; i < frames.size(); i++)
       {
@@ -190,9 +191,9 @@ public class ThreadReferenceCommandSet
       throws JdwpException, IOException
   {
     ThreadId tid = (ThreadId) idMan.readObjectId(bb);
-    Thread thread = (Thread) tid.getObject();
+    Thread thread = tid.getThread();
 
-    int frameCount = vm.getFrameCount(thread);
+    int frameCount = VMVirtualMachine.getFrameCount(thread);
     os.writeInt(frameCount);
   }
 
@@ -219,16 +220,17 @@ public class ThreadReferenceCommandSet
       throws JdwpException, IOException
   {
     ThreadId tid = (ThreadId) idMan.readObjectId(bb);
-    Thread thread = (Thread) tid.getObject();
+    Thread thread = tid.getThread();
     ObjectId exception = idMan.readObjectId(bb);
-    vm.stopThread(thread, (Exception) exception.getObject());
+    Throwable throwable = (Throwable) exception.getObject();
+    thread.stop (throwable);
   }
 
   private void executeInterrupt(ByteBuffer bb, DataOutputStream os)
       throws JdwpException, IOException
   {
     ThreadId tid = (ThreadId) idMan.readObjectId(bb);
-    Thread thread = (Thread) tid.getObject();
+    Thread thread = tid.getThread();
     thread.interrupt();
   }
 
@@ -236,8 +238,8 @@ public class ThreadReferenceCommandSet
       throws JdwpException, IOException
   {
     ThreadId tid = (ThreadId) idMan.readObjectId(bb);
-    Thread thread = (Thread) tid.getObject();
-    int suspendCount = vm.getSuspendCount(thread);
+    Thread thread = tid.getThread();
+    int suspendCount = VMVirtualMachine.getSuspendCount(thread);
     os.writeInt(suspendCount);
   }
 }
Index: gnu/classpath/jdwp/processor/VirtualMachineCommandSet.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/gnu/classpath/jdwp/processor/VirtualMachineCommandSet.java,v
retrieving revision 1.3
diff -u -p -r1.3 VirtualMachineCommandSet.java
--- gnu/classpath/jdwp/processor/VirtualMachineCommandSet.java  25 Aug 2005 
22:09:49 -0000      1.3
+++ gnu/classpath/jdwp/processor/VirtualMachineCommandSet.java  2 Sep 2005 
20:43:41 -0000
@@ -39,8 +39,8 @@ exception statement from your version. *
 
 package gnu.classpath.jdwp.processor;
 
-import gnu.classpath.jdwp.Jdwp;
 import gnu.classpath.jdwp.JdwpConstants;
+import gnu.classpath.jdwp.VMVirtualMachine;
 import gnu.classpath.jdwp.exception.JdwpException;
 import gnu.classpath.jdwp.exception.JdwpInternalErrorException;
 import gnu.classpath.jdwp.exception.NotImplementedException;
@@ -64,9 +64,6 @@ import java.util.Properties;
 public class VirtualMachineCommandSet
   extends CommandSet
 {
-  // The Jdwp object
-  private final Jdwp jdwp = Jdwp.getDefault();
-
   public boolean runCommand(ByteBuffer bb, DataOutputStream os, byte command)
     throws JdwpException
   {
@@ -180,7 +177,7 @@ public class VirtualMachineCommandSet
     ArrayList allMatchingClasses = new ArrayList();
 
     // This will be an Iterator over all loaded Classes
-    Iterator iter = vm.getAllLoadedClasses();
+    Iterator iter = VMVirtualMachine.getAllLoadedClasses();
 
     while (iter.hasNext())
       {
@@ -196,7 +193,7 @@ public class VirtualMachineCommandSet
         Class clazz = (Class) allMatchingClasses.get(i);
         ReferenceTypeId id = idMan.getReferenceTypeId(clazz);
         id.writeTagged(os);
-        int status = vm.getStatus(clazz);
+        int status = VMVirtualMachine.getClassStatus(clazz);
         os.writeInt(status);
       }
   }
@@ -207,14 +204,14 @@ public class VirtualMachineCommandSet
     // Disable garbage collection while we're collecting the info on loaded
     // classes so we some classes don't get collected between the time we get
     // the count and the time we get the list
-    vm.disableGarbageCollection();
+    //VMVirtualMachine.disableGarbageCollection();
 
-    int classCount = vm.getAllLoadedClassesCount();
+    int classCount = VMVirtualMachine.getAllLoadedClassesCount();
     os.writeInt(classCount);
 
     // This will be an Iterator over all loaded Classes
-    Iterator iter = vm.getAllLoadedClasses();
-    vm.enableGarbageCollection();
+    Iterator iter = VMVirtualMachine.getAllLoadedClasses();
+    //VMVirtualMachine.enableGarbageCollection();
     int count = 0;
 
     // Note it's possible classes were created since out classCount so make
@@ -226,7 +223,7 @@ public class VirtualMachineCommandSet
         id.writeTagged(os);
         String sig = Signature.computeClassSignature(clazz);
         JdwpString.writeString(os, sig);
-        int status = vm.getStatus(clazz);
+        int status = VMVirtualMachine.getClassStatus(clazz);
         os.writeInt(status);
       }
   }
@@ -270,7 +267,7 @@ public class VirtualMachineCommandSet
   private void executeTopLevelThreadGroups(ByteBuffer bb, DataOutputStream os)
     throws JdwpException, IOException
   {
-    ThreadGroup jdwpGroup = jdwp.getJdwpThreadGroup();
+    ThreadGroup jdwpGroup = Thread.currentThread().getThreadGroup ();
     ThreadGroup root = getRootThreadGroup(jdwpGroup);
 
     os.writeInt(1); // Just one top level group allowed?
@@ -284,11 +281,11 @@ public class VirtualMachineCommandSet
     // suspended multiple times, we likely need a way to keep track of how many
     // times a thread has been suspended or else a stronger resume method for
     // this purpose
-    // vm.resumeAllThreadsExcept(jdwp.getJdwpThreadGroup());
+    // VMVirtualMachine.resumeAllThreads ();
 
     // Simply shutting down the jdwp layer will take care of the rest of the
     // shutdown other than disabling debugging in the VM
-    // vm.disableDebugging();
+    // VMVirtualMachine.disableDebugging();
 
     // Don't implement this until we're sure how to remove all the debugging
     // effects from the VM.
@@ -311,20 +308,20 @@ public class VirtualMachineCommandSet
   private void executeSuspend(ByteBuffer bb, DataOutputStream os)
     throws JdwpException
   {
-    vm.suspendAllThreadsExcept(jdwp.getJdwpThreadGroup());
+    VMVirtualMachine.suspendAllThreads ();
   }
 
   private void executeResume(ByteBuffer bb, DataOutputStream os)
     throws JdwpException
   {
-    vm.resumeAllThreadsExcept(jdwp.getJdwpThreadGroup());
+    VMVirtualMachine.resumeAllThreads ();
   }
 
   private void executeExit(ByteBuffer bb, DataOutputStream os)
     throws JdwpException, IOException
   {
     int exitCode = bb.getInt();
-    jdwp.setExit(exitCode);
+    System.exit (exitCode);
   }
 
   private void executeCreateString(ByteBuffer bb, DataOutputStream os)
Index: gnu/classpath/jdwp/event/EventManager.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/gnu/classpath/jdwp/event/EventManager.java,v
retrieving revision 1.1
diff -u -p -r1.1 EventManager.java
--- gnu/classpath/jdwp/event/EventManager.java  25 Aug 2005 20:59:08 -0000      
1.1
+++ gnu/classpath/jdwp/event/EventManager.java  2 Sep 2005 20:44:02 -0000
@@ -202,7 +202,7 @@ public class EventManager
       }
 
     // Register the event with the VM
-    VMVirtualMachine.getDefault().registerEvent (request);
+    VMVirtualMachine.registerEvent (request);
     requests.put (new Integer (request.getId ()), request);
   }
 
@@ -227,7 +227,7 @@ public class EventManager
     EventRequest request = (EventRequest) requests.get (iid);
     if (request != null)
       {
-       VMVirtualMachine.getDefault().unregisterEvent (request);
+       VMVirtualMachine.unregisterEvent (request);
        requests.remove (iid);
       }
   }
@@ -247,7 +247,7 @@ public class EventManager
        throw new IllegalArgumentException ("invalid event kind: " + kind);
       }
 
-    VMVirtualMachine.getDefault().clearEvents (kind);
+    VMVirtualMachine.clearEvents (kind);
     requests.clear ();
   }
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]