This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA/JDWP] Fix VariableTable


This fix, now in classpath, fixes jdwp/util/VariableTable. Previously, two variables were longs, where the spec says they should be ints. This causes the variable table data to be corrupted when it is sent to the debugger.

ChangeLog
2007-04-03  Kyle Galloway  <kgallowa@redhat.com>

   * classpath/gnu/classpath/jdwp/util/VariableTable.java: Change longs
   to ints for argCnt and slots.
   (write): Replace writeLong with writeInt for the above.

Questions/comments/concerns?

Thanks,
Kyle
Index: /notnfs/kgallowa/work/gcc/libjava/classpath/gnu/classpath/jdwp/util/VariableTable.java
===================================================================
--- /notnfs/kgallowa/work/gcc/libjava/classpath/gnu/classpath/jdwp/util/VariableTable.java	(revision 123426)
+++ /notnfs/kgallowa/work/gcc/libjava/classpath/gnu/classpath/jdwp/util/VariableTable.java	(working copy)
@@ -50,9 +50,9 @@
 public class VariableTable
 {
 
-  private final long argCnt;
+  private final int argCnt;
 
-  private final long slots;
+  private final int slots;
 
   private final long[] lineCI;
 
@@ -95,8 +95,8 @@
    */
   public void write(DataOutputStream os) throws IOException
   {
-    os.writeLong(argCnt);
-    os.writeLong(slots);
+    os.writeInt(argCnt);
+    os.writeInt(slots);
     for (int i = 0; i < slots; i++)
       {
         os.writeLong(lineCI[i]);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]