OSDN Git Service

save
authoriga <tosiki.iga@nifty.ne.jp>
Tue, 1 Apr 2014 21:48:21 +0000 (06:48 +0900)
committeriga <tosiki.iga@nifty.ne.jp>
Tue, 1 Apr 2014 21:48:21 +0000 (06:48 +0900)
jcfa/src/jp/igapyon/jcfa/JcfaParser.java
jcfa/src/jp/igapyon/jcfa/util/JcfaWriteUtil.java
jcfa/testJavaClass/output/test/TestJavaClass032.jcfa [new file with mode: 0644]
jcfa/testJavaClass/src/test/TestJavaClass032.java [new file with mode: 0644]

index a5c1e19..48ec20e 100644 (file)
@@ -184,6 +184,7 @@ public class JcfaParser {
                                                codes[pc + 3], codes[pc + 4]);
                                jcfaCode.getComment().getCommentList()
                                                .add("  TODO skipping operands: why?: " + result);
+                               System.out.println("skipBytes: " + result);
 
                                int lookupOp = pc + 5;
 
@@ -192,6 +193,8 @@ public class JcfaParser {
                                int loopCount = JcfaUtil
                                                .byte2Int(codes[lookupOp++], codes[lookupOp++],
                                                                codes[lookupOp++], codes[lookupOp++]);
+                               System.out.println("count: " + loopCount);
+
                                // switch table on loopCount.
 
                                short diff2 = JcfaUtil.byte2UnsignedByte(codes[lookupOp++]);
index ff41811..6c9251b 100644 (file)
@@ -162,6 +162,7 @@ public class JcfaWriteUtil {
                        case Constants.LOOKUPSWITCH:
                                int skipBytes = JcfaUtil.byte2Int(codes[1], codes[2], codes[3],
                                                codes[4]);
+                               
                                jcfaCode.getComment().getCommentList()
                                                .add("  TODO skipping bytes: " + (skipBytes));
 
diff --git a/jcfa/testJavaClass/output/test/TestJavaClass032.jcfa b/jcfa/testJavaClass/output/test/TestJavaClass032.jcfa
new file mode 100644 (file)
index 0000000..331d689
--- /dev/null
@@ -0,0 +1,37 @@
+package test;
+
+/** TODO import func. is missing. */
+public class TestJavaClass032 {
+       /** Default constructor. */
+       public TestJavaClass032() {
+               /*
+                * 0: aload_0 TODO unsupported opcode
+                */
+
+               /*
+                * 1: invokespecial java/lang/Object#<init>()V
+                */
+
+               /* 4: return */
+       }
+
+       /** Method. */
+       public void switchSample() {
+               /*
+                * 0: iconst_5 TODO unsupported opcode
+                */
+
+               /*
+                * 1: istore_1 TODO unsupported opcode
+                */
+
+               /*
+                * 2: iload_1 TODO unsupported opcode
+                */
+
+               /*
+                * 3: tableswitch TODO no support opecode and operands TODO unsupported
+                * opcode
+                */
+       }
+}
\ No newline at end of file
diff --git a/jcfa/testJavaClass/src/test/TestJavaClass032.java b/jcfa/testJavaClass/src/test/TestJavaClass032.java
new file mode 100644 (file)
index 0000000..9bfa98b
--- /dev/null
@@ -0,0 +1,23 @@
+package test;
+
+/**
+ * Simple test class for JavaClassFileAnalyzer.
+ * 
+ * @author Toshiki Iga
+ */
+public class TestJavaClass032 {
+       public void switchSample() {
+               int i = 5;
+               switch (i) {
+               case 1:
+                       System.out.println("Test: " + i);
+                       break;
+               case 100:
+                       System.out.println("Test: " + i);
+                       break;
+               default:
+                       System.out.println("Default: " + i);
+                       break;
+               }
+       }
+}