40 |
|
|
41 |
package gnu.classpath.jdwp.processor; |
package gnu.classpath.jdwp.processor; |
42 |
|
|
|
import gnu.classpath.jdwp.Jdwp; |
|
43 |
import gnu.classpath.jdwp.JdwpConstants; |
import gnu.classpath.jdwp.JdwpConstants; |
44 |
import gnu.classpath.jdwp.exception.InvalidObjectException; |
import gnu.classpath.jdwp.exception.InvalidObjectException; |
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.util.Value; |
import gnu.classpath.jdwp.util.Value; |
50 |
|
|
58 |
* |
* |
59 |
* @author Aaron Luchko <aluchko@redhat.com> |
* @author Aaron Luchko <aluchko@redhat.com> |
60 |
*/ |
*/ |
61 |
public class ArrayReferenceCommandSet implements CommandSet |
public class ArrayReferenceCommandSet |
62 |
|
extends CommandSet |
63 |
{ |
{ |
|
// Manages all the different ids that are assigned by jdwp |
|
|
private final IdManager idMan = Jdwp.getIdManager(); |
|
|
|
|
64 |
public boolean runCommand(ByteBuffer bb, DataOutputStream os, byte command) |
public boolean runCommand(ByteBuffer bb, DataOutputStream os, byte command) |
65 |
throws JdwpException |
throws JdwpException |
66 |
{ |
{ |
94 |
private void executeLength(ByteBuffer bb, DataOutputStream os) |
private void executeLength(ByteBuffer bb, DataOutputStream os) |
95 |
throws InvalidObjectException, IOException |
throws InvalidObjectException, IOException |
96 |
{ |
{ |
97 |
ObjectId oid = idMan.readId(bb); |
ObjectId oid = idMan.readObjectId(bb); |
98 |
Object array = oid.getObject(); |
Object array = oid.getObject(); |
99 |
os.writeInt(Array.getLength(array)); |
os.writeInt(Array.getLength(array)); |
100 |
} |
} |
102 |
private void executeGetValues(ByteBuffer bb, DataOutputStream os) |
private void executeGetValues(ByteBuffer bb, DataOutputStream os) |
103 |
throws JdwpException, IOException |
throws JdwpException, IOException |
104 |
{ |
{ |
105 |
ObjectId oid = idMan.readId(bb); |
ObjectId oid = idMan.readObjectId(bb); |
106 |
Object array = oid.getObject(); |
Object array = oid.getObject(); |
107 |
int first = bb.getInt(); |
int first = bb.getInt(); |
108 |
int length = bb.getInt(); |
int length = bb.getInt(); |
160 |
private void executeSetValues(ByteBuffer bb, DataOutputStream os) |
private void executeSetValues(ByteBuffer bb, DataOutputStream os) |
161 |
throws IOException, JdwpException |
throws IOException, JdwpException |
162 |
{ |
{ |
163 |
ObjectId oid = idMan.readId(bb); |
ObjectId oid = idMan.readObjectId(bb); |
164 |
Object array = oid.getObject(); |
Object array = oid.getObject(); |
165 |
int first = bb.getInt(); |
int first = bb.getInt(); |
166 |
int length = bb.getInt(); |
int length = bb.getInt(); |