40 |
package gnu.classpath.jdwp.processor; |
package gnu.classpath.jdwp.processor; |
41 |
|
|
42 |
import gnu.classpath.jdwp.VMFrame; |
import gnu.classpath.jdwp.VMFrame; |
|
import gnu.classpath.jdwp.IVirtualMachine; |
|
|
import gnu.classpath.jdwp.Jdwp; |
|
43 |
import gnu.classpath.jdwp.JdwpConstants; |
import gnu.classpath.jdwp.JdwpConstants; |
44 |
import gnu.classpath.jdwp.exception.JdwpException; |
import gnu.classpath.jdwp.exception.JdwpException; |
45 |
import gnu.classpath.jdwp.exception.JdwpInternalErrorException; |
import gnu.classpath.jdwp.exception.JdwpInternalErrorException; |
46 |
import gnu.classpath.jdwp.exception.NotImplementedException; |
import gnu.classpath.jdwp.exception.NotImplementedException; |
|
import gnu.classpath.jdwp.id.IdManager; |
|
47 |
import gnu.classpath.jdwp.id.ObjectId; |
import gnu.classpath.jdwp.id.ObjectId; |
48 |
import gnu.classpath.jdwp.util.Value; |
import gnu.classpath.jdwp.util.Value; |
49 |
|
|
56 |
* |
* |
57 |
* @author Aaron Luchko <aluchko@redhat.com> |
* @author Aaron Luchko <aluchko@redhat.com> |
58 |
*/ |
*/ |
59 |
public class StackFrameCommandSet implements CommandSet |
public class StackFrameCommandSet |
60 |
|
extends CommandSet |
61 |
{ |
{ |
|
// 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(); |
|
|
|
|
62 |
public boolean runCommand(ByteBuffer bb, DataOutputStream os, byte command) |
public boolean runCommand(ByteBuffer bb, DataOutputStream os, byte command) |
63 |
throws JdwpException |
throws JdwpException |
64 |
{ |
{ |
96 |
private void executeGetValues(ByteBuffer bb, DataOutputStream os) |
private void executeGetValues(ByteBuffer bb, DataOutputStream os) |
97 |
throws JdwpException, IOException |
throws JdwpException, IOException |
98 |
{ |
{ |
99 |
ObjectId tId = idMan.readId(bb); |
ObjectId tId = idMan.readObjectId(bb); |
100 |
Thread thread = (Thread) tId.getObject(); |
Thread thread = (Thread) tId.getObject(); |
101 |
|
|
102 |
// Although Frames look like other ids they are not. First they are not |
// Although Frames look like other ids they are not. First they are not |
120 |
private void executeSetValues(ByteBuffer bb, DataOutputStream os) |
private void executeSetValues(ByteBuffer bb, DataOutputStream os) |
121 |
throws JdwpException, IOException |
throws JdwpException, IOException |
122 |
{ |
{ |
123 |
ObjectId tId = idMan.readId(bb); |
ObjectId tId = idMan.readObjectId(bb); |
124 |
Thread thread = (Thread) tId.getObject(); |
Thread thread = (Thread) tId.getObject(); |
125 |
|
|
126 |
VMFrame frame = vm.getVMFrame(thread, bb); |
VMFrame frame = vm.getVMFrame(thread, bb); |
137 |
private void executeThisObject(ByteBuffer bb, DataOutputStream os) |
private void executeThisObject(ByteBuffer bb, DataOutputStream os) |
138 |
throws JdwpException, IOException |
throws JdwpException, IOException |
139 |
{ |
{ |
140 |
ObjectId tId = idMan.readId(bb); |
ObjectId tId = idMan.readObjectId(bb); |
141 |
Thread thread = (Thread) tId.getObject(); |
Thread thread = (Thread) tId.getObject(); |
142 |
|
|
143 |
VMFrame frame = vm.getVMFrame(thread, bb); |
VMFrame frame = vm.getVMFrame(thread, bb); |