/[classpath]/classpath/gnu/classpath/jdwp/processor/ThreadReferenceCommandSet.java
ViewVC logotype

Diff of /classpath/gnu/classpath/jdwp/processor/ThreadReferenceCommandSet.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by keiths, Thu Aug 25 22:09:49 2005 UTC revision 1.5 by keiths, Fri Sep 2 20:48:25 2005 UTC
# Line 39  exception statement from your version. * Line 39  exception statement from your version. *
39    
40  package gnu.classpath.jdwp.processor;  package gnu.classpath.jdwp.processor;
41    
 import gnu.classpath.jdwp.VMFrame;  
42  import gnu.classpath.jdwp.JdwpConstants;  import gnu.classpath.jdwp.JdwpConstants;
43    import gnu.classpath.jdwp.VMFrame;
44    import gnu.classpath.jdwp.VMVirtualMachine;
45  import gnu.classpath.jdwp.exception.InvalidObjectException;  import gnu.classpath.jdwp.exception.InvalidObjectException;
46  import gnu.classpath.jdwp.exception.JdwpException;  import gnu.classpath.jdwp.exception.JdwpException;
47  import gnu.classpath.jdwp.exception.JdwpInternalErrorException;  import gnu.classpath.jdwp.exception.JdwpInternalErrorException;
# Line 124  public class ThreadReferenceCommandSet Line 125  public class ThreadReferenceCommandSet
125        throws JdwpException, IOException        throws JdwpException, IOException
126    {    {
127      ThreadId tid = (ThreadId) idMan.readObjectId(bb);      ThreadId tid = (ThreadId) idMan.readObjectId(bb);
128      Thread thread = (Thread) tid.getObject();      Thread thread = tid.getThread();
129      JdwpString.writeString(os, thread.getName());      JdwpString.writeString(os, thread.getName());
130    }    }
131    
# Line 132  public class ThreadReferenceCommandSet Line 133  public class ThreadReferenceCommandSet
133        throws JdwpException, IOException        throws JdwpException, IOException
134    {    {
135      ThreadId tid = (ThreadId) idMan.readObjectId(bb);      ThreadId tid = (ThreadId) idMan.readObjectId(bb);
136      Thread thread = (Thread) tid.getObject();      Thread thread = tid.getThread();
137      vm.suspendThread(thread);      VMVirtualMachine.suspendThread(thread);
138    }    }
139    
140    private void executeResume(ByteBuffer bb, DataOutputStream os)    private void executeResume(ByteBuffer bb, DataOutputStream os)
141        throws JdwpException, IOException        throws JdwpException, IOException
142    {    {
143      ThreadId tid = (ThreadId) idMan.readObjectId(bb);      ThreadId tid = (ThreadId) idMan.readObjectId(bb);
144      Thread thread = (Thread) tid.getObject();      Thread thread = tid.getThread();
145      vm.suspendThread(thread);      VMVirtualMachine.suspendThread(thread);
146    }    }
147    
148    private void executeStatus(ByteBuffer bb, DataOutputStream os)    private void executeStatus(ByteBuffer bb, DataOutputStream os)
149        throws InvalidObjectException, IOException        throws JdwpException, IOException
150    {    {
151      ThreadId tid = (ThreadId) idMan.readObjectId(bb);      ThreadId tid = (ThreadId) idMan.readObjectId(bb);
152      Thread thread = (Thread) tid.getObject();      Thread thread = tid.getThread();
153      int threadStatus = vm.getThreadStatus(thread);      int threadStatus = VMVirtualMachine.getThreadStatus(thread);
154      // There's only one possible SuspendStatus...      // There's only one possible SuspendStatus...
155      int suspendStatus = JdwpConstants.SuspendStatus.SUSPENDED;      int suspendStatus = JdwpConstants.SuspendStatus.SUSPENDED;
156    
# Line 158  public class ThreadReferenceCommandSet Line 159  public class ThreadReferenceCommandSet
159    }    }
160    
161    private void executeThreadGroup(ByteBuffer bb, DataOutputStream os)    private void executeThreadGroup(ByteBuffer bb, DataOutputStream os)
162        throws InvalidObjectException, IOException        throws JdwpException, IOException
163    {    {
164      ThreadId tid = (ThreadId) idMan.readObjectId(bb);      ThreadId tid = (ThreadId) idMan.readObjectId(bb);
165      Thread thread = (Thread) tid.getObject();      Thread thread = tid.getThread();
166      ThreadGroup group = thread.getThreadGroup();      ThreadGroup group = thread.getThreadGroup();
167      ObjectId groupId = idMan.getObjectId(group);      ObjectId groupId = idMan.getObjectId(group);
168      groupId.write(os);      groupId.write(os);
# Line 171  public class ThreadReferenceCommandSet Line 172  public class ThreadReferenceCommandSet
172        throws JdwpException, IOException        throws JdwpException, IOException
173    {    {
174      ThreadId tid = (ThreadId) idMan.readObjectId(bb);      ThreadId tid = (ThreadId) idMan.readObjectId(bb);
175      Thread thread = (Thread) tid.getObject();      Thread thread = tid.getThread();
176      int startFrame = bb.getInt();      int startFrame = bb.getInt();
177      int length = bb.getInt();      int length = bb.getInt();
178    
179      ArrayList frames = vm.getVMFrames(thread, startFrame, length);      ArrayList frames = VMVirtualMachine.getFrames(thread, startFrame, length);
180      os.writeInt(frames.size());      os.writeInt(frames.size());
181      for (int i = 0; i < frames.size(); i++)      for (int i = 0; i < frames.size(); i++)
182        {        {
# Line 190  public class ThreadReferenceCommandSet Line 191  public class ThreadReferenceCommandSet
191        throws JdwpException, IOException        throws JdwpException, IOException
192    {    {
193      ThreadId tid = (ThreadId) idMan.readObjectId(bb);      ThreadId tid = (ThreadId) idMan.readObjectId(bb);
194      Thread thread = (Thread) tid.getObject();      Thread thread = tid.getThread();
195    
196      int frameCount = vm.getFrameCount(thread);      int frameCount = VMVirtualMachine.getFrameCount(thread);
197      os.writeInt(frameCount);      os.writeInt(frameCount);
198    }    }
199    
# Line 219  public class ThreadReferenceCommandSet Line 220  public class ThreadReferenceCommandSet
220        throws JdwpException, IOException        throws JdwpException, IOException
221    {    {
222      ThreadId tid = (ThreadId) idMan.readObjectId(bb);      ThreadId tid = (ThreadId) idMan.readObjectId(bb);
223      Thread thread = (Thread) tid.getObject();      Thread thread = tid.getThread();
224      ObjectId exception = idMan.readObjectId(bb);      ObjectId exception = idMan.readObjectId(bb);
225      vm.stopThread(thread, (Exception) exception.getObject());      Throwable throwable = (Throwable) exception.getObject();
226        thread.stop (throwable);
227    }    }
228    
229    private void executeInterrupt(ByteBuffer bb, DataOutputStream os)    private void executeInterrupt(ByteBuffer bb, DataOutputStream os)
230        throws JdwpException, IOException        throws JdwpException, IOException
231    {    {
232      ThreadId tid = (ThreadId) idMan.readObjectId(bb);      ThreadId tid = (ThreadId) idMan.readObjectId(bb);
233      Thread thread = (Thread) tid.getObject();      Thread thread = tid.getThread();
234      thread.interrupt();      thread.interrupt();
235    }    }
236    
# Line 236  public class ThreadReferenceCommandSet Line 238  public class ThreadReferenceCommandSet
238        throws JdwpException, IOException        throws JdwpException, IOException
239    {    {
240      ThreadId tid = (ThreadId) idMan.readObjectId(bb);      ThreadId tid = (ThreadId) idMan.readObjectId(bb);
241      Thread thread = (Thread) tid.getObject();      Thread thread = tid.getThread();
242      int suspendCount = vm.getSuspendCount(thread);      int suspendCount = VMVirtualMachine.getSuspendCount(thread);
243      os.writeInt(suspendCount);      os.writeInt(suspendCount);
244    }    }
245  }  }

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26