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

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

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

revision 1.2.2.1 by gnu_andrew, Tue Aug 2 20:12:08 2005 UTC revision 1.2.2.2 by gnu_andrew, Sat Sep 10 15:31:36 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.IVirtualMachine;  
 import gnu.classpath.jdwp.Jdwp;  
42  import gnu.classpath.jdwp.JdwpConstants;  import gnu.classpath.jdwp.JdwpConstants;
43    import gnu.classpath.jdwp.VMVirtualMachine;
44  import gnu.classpath.jdwp.exception.InvalidFieldException;  import gnu.classpath.jdwp.exception.InvalidFieldException;
45  import gnu.classpath.jdwp.exception.JdwpException;  import gnu.classpath.jdwp.exception.JdwpException;
46  import gnu.classpath.jdwp.exception.JdwpInternalErrorException;  import gnu.classpath.jdwp.exception.JdwpInternalErrorException;
47  import gnu.classpath.jdwp.exception.NotImplementedException;  import gnu.classpath.jdwp.exception.NotImplementedException;
 import gnu.classpath.jdwp.id.IdManager;  
48  import gnu.classpath.jdwp.id.ObjectId;  import gnu.classpath.jdwp.id.ObjectId;
49  import gnu.classpath.jdwp.id.ReferenceTypeId;  import gnu.classpath.jdwp.id.ReferenceTypeId;
50  import gnu.classpath.jdwp.util.JdwpString;  import gnu.classpath.jdwp.util.JdwpString;
# Line 64  import java.nio.ByteBuffer; Line 62  import java.nio.ByteBuffer;
62   *   *
63   * @author Aaron Luchko <aluchko@redhat.com>   * @author Aaron Luchko <aluchko@redhat.com>
64   */   */
65  public class ReferenceTypeCommandSet implements CommandSet  public class ReferenceTypeCommandSet
66      extends CommandSet
67  {  {
   // Our hook into the jvm  
   private final IVirtualMachine vm = Jdwp.getIVirtualMachine();  
   
   // Manages all the different ids that are assigned by jdwp  
   private final IdManager idMan = Jdwp.getIdManager();  
   
68    public boolean runCommand(ByteBuffer bb, DataOutputStream os, byte command)    public boolean runCommand(ByteBuffer bb, DataOutputStream os, byte command)
69      throws JdwpException      throws JdwpException
70    {    {
# Line 153  public class ReferenceTypeCommandSet imp Line 146  public class ReferenceTypeCommandSet imp
146    
147      Class clazz = refId.getType();      Class clazz = refId.getType();
148      ClassLoader loader = clazz.getClassLoader();      ClassLoader loader = clazz.getClassLoader();
149      ObjectId oid = idMan.getId(loader);      ObjectId oid = idMan.getObjectId(loader);
150      oid.write(os);      oid.write(os);
151    }    }
152    
# Line 177  public class ReferenceTypeCommandSet imp Line 170  public class ReferenceTypeCommandSet imp
170      for (int i = 0; i < fields.length; i++)      for (int i = 0; i < fields.length; i++)
171        {        {
172          Field field = fields[i];          Field field = fields[i];
173          idMan.getId(field).write(os);          idMan.getObjectId(field).write(os);
174          JdwpString.writeString(os, field.getName());          JdwpString.writeString(os, field.getName());
175          JdwpString.writeString(os, Signature.computeFieldSignature(field));          JdwpString.writeString(os, Signature.computeFieldSignature(field));
176          os.writeInt(field.getModifiers());          os.writeInt(field.getModifiers());
# Line 195  public class ReferenceTypeCommandSet imp Line 188  public class ReferenceTypeCommandSet imp
188      for (int i = 0; i < methods.length; i++)      for (int i = 0; i < methods.length; i++)
189        {        {
190          Method method = methods[i];          Method method = methods[i];
191          idMan.getId(method).write(os);          idMan.getObjectId(method).write(os);
192          JdwpString.writeString(os, method.getName());          JdwpString.writeString(os, method.getName());
193          JdwpString.writeString(os, Signature.computeMethodSignature(method));          JdwpString.writeString(os, Signature.computeMethodSignature(method));
194          os.writeInt(method.getModifiers());          os.writeInt(method.getModifiers());
# Line 212  public class ReferenceTypeCommandSet imp Line 205  public class ReferenceTypeCommandSet imp
205      os.writeInt(numFields); // Looks pointless but this is the protocol      os.writeInt(numFields); // Looks pointless but this is the protocol
206      for (int i = 0; i < numFields; i++)      for (int i = 0; i < numFields; i++)
207        {        {
208          ObjectId fieldId = idMan.readId(bb);          ObjectId fieldId = idMan.readObjectId(bb);
209          Field field = (Field) (fieldId.getObject());          Field field = (Field) (fieldId.getObject());
210          Class fieldClazz = field.getDeclaringClass();          Class fieldClazz = field.getDeclaringClass();
211    
# Line 249  public class ReferenceTypeCommandSet imp Line 242  public class ReferenceTypeCommandSet imp
242      Class clazz = refId.getType();      Class clazz = refId.getType();
243    
244      // We'll need to go into the jvm for this unless there's an easier way      // We'll need to go into the jvm for this unless there's an easier way
245      String sourceFileName = vm.getSourceFile(clazz);      String sourceFileName = VMVirtualMachine.getSourceFile(clazz);
246      JdwpString.writeString(os, sourceFileName);      JdwpString.writeString(os, sourceFileName);
247      // clazz.getProtectionDomain().getCodeSource().getLocation();      // clazz.getProtectionDomain().getCodeSource().getLocation();
248    }    }
# Line 276  public class ReferenceTypeCommandSet imp Line 269  public class ReferenceTypeCommandSet imp
269      Class clazz = refId.getType();      Class clazz = refId.getType();
270    
271      // I don't think there's any other way to get this      // I don't think there's any other way to get this
272      int status = vm.getStatus(clazz);      int status = VMVirtualMachine.getClassStatus(clazz);
273      os.writeInt(status);      os.writeInt(status);
274    }    }
275    
# Line 300  public class ReferenceTypeCommandSet imp Line 293  public class ReferenceTypeCommandSet imp
293    {    {
294      ReferenceTypeId refId = idMan.readReferenceTypeId(bb);      ReferenceTypeId refId = idMan.readReferenceTypeId(bb);
295      Class clazz = refId.getType();      Class clazz = refId.getType();
296      ObjectId clazzObjectId = idMan.getId(clazz);      ObjectId clazzObjectId = idMan.getObjectId(clazz);
297      clazzObjectId.write(os);      clazzObjectId.write(os);
298    }    }
299    

Legend:
Removed from v.1.2.2.1  
changed lines
  Added in v.1.2.2.2

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