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

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

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

revision 1.2.2.1 by gnu_andrew, Tue Aug 16 16:22:36 2005 UTC revision 1.2.2.2 by gnu_andrew, Sat Sep 10 15:31:36 2005 UTC
# Line 15  General Public License for more details. Line 15  General Public License for more details.
15    
16  You should have received a copy of the GNU General Public License  You should have received a copy of the GNU General Public License
17  along with GNU Classpath; see the file COPYING.  If not, write to the  along with GNU Classpath; see the file COPYING.  If not, write to the
18  Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  02111-1307 USA.  02110-1301 USA.
20    
21  Linking this library statically or dynamically with other modules is  Linking this library statically or dynamically with other modules is
22  making a combined work based on this library.  Thus, the terms and  making a combined work based on this library.  Thus, the terms and
# 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;  
 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.VMFrame;
44    import gnu.classpath.jdwp.VMVirtualMachine;
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    
# Line 59  import java.nio.ByteBuffer; Line 57  import java.nio.ByteBuffer;
57   *   *
58   * @author Aaron Luchko <aluchko@redhat.com>   * @author Aaron Luchko <aluchko@redhat.com>
59   */   */
60  public class StackFrameCommandSet implements CommandSet  public class StackFrameCommandSet
61      extends CommandSet
62  {  {
   // 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();  
   
63    public boolean runCommand(ByteBuffer bb, DataOutputStream os, byte command)    public boolean runCommand(ByteBuffer bb, DataOutputStream os, byte command)
64        throws JdwpException        throws JdwpException
65    {    {
# Line 104  public class StackFrameCommandSet implem Line 97  public class StackFrameCommandSet implem
97    private void executeGetValues(ByteBuffer bb, DataOutputStream os)    private void executeGetValues(ByteBuffer bb, DataOutputStream os)
98        throws JdwpException, IOException        throws JdwpException, IOException
99    {    {
100      ObjectId tId = idMan.readId(bb);      ObjectId tId = idMan.readObjectId(bb);
101      Thread thread = (Thread) tId.getObject();      Thread thread = (Thread) tId.getObject();
102    
103      // 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
# Line 113  public class StackFrameCommandSet implem Line 106  public class StackFrameCommandSet implem
106      // has a reference to them. Furthermore they are not ReferenceTypeIds since      // has a reference to them. Furthermore they are not ReferenceTypeIds since
107      // these are held permanently and we want these to be held only as long as      // these are held permanently and we want these to be held only as long as
108      // the Thread is suspended.      // the Thread is suspended.
109      VMFrame frame = vm.getVMFrame(thread, bb);      VMFrame frame = VMVirtualMachine.getFrame(thread, bb);
110      int slots = bb.getInt();      int slots = bb.getInt();
111      os.writeInt(slots); // Looks pointless but this is the protocol      os.writeInt(slots); // Looks pointless but this is the protocol
112      for (int i = 0; i < slots; i++)      for (int i = 0; i < slots; i++)
# Line 128  public class StackFrameCommandSet implem Line 121  public class StackFrameCommandSet implem
121    private void executeSetValues(ByteBuffer bb, DataOutputStream os)    private void executeSetValues(ByteBuffer bb, DataOutputStream os)
122        throws JdwpException, IOException        throws JdwpException, IOException
123    {    {
124      ObjectId tId = idMan.readId(bb);      ObjectId tId = idMan.readObjectId(bb);
125      Thread thread = (Thread) tId.getObject();      Thread thread = (Thread) tId.getObject();
126    
127      VMFrame frame = vm.getVMFrame(thread, bb);      VMFrame frame = VMVirtualMachine.getFrame(thread, bb);
128    
129      int slots = bb.getInt();      int slots = bb.getInt();
130      for (int i = 0; i < slots; i++)      for (int i = 0; i < slots; i++)
# Line 145  public class StackFrameCommandSet implem Line 138  public class StackFrameCommandSet implem
138    private void executeThisObject(ByteBuffer bb, DataOutputStream os)    private void executeThisObject(ByteBuffer bb, DataOutputStream os)
139        throws JdwpException, IOException        throws JdwpException, IOException
140    {    {
141      ObjectId tId = idMan.readId(bb);      ObjectId tId = idMan.readObjectId(bb);
142      Thread thread = (Thread) tId.getObject();      Thread thread = (Thread) tId.getObject();
143    
144      VMFrame frame = vm.getVMFrame(thread, bb);      VMFrame frame = VMVirtualMachine.getFrame(thread, bb);
145    
146      Object thisObject = frame.getObject();      Object thisObject = frame.getObject();
147      Value.writeTaggedValue(os, thisObject);      Value.writeTaggedValue(os, thisObject);

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