[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: soot xml output



I have no idea what the implications of no VTA or XSLT are, but if you
want to do a quick and dirty (very dirty, hehe) hack to get the
labels, try something like:

Index: XMLPrinter.java
===================================================================
--- XMLPrinter.java     (revision 1082)
+++ XMLPrinter.java     (working copy)
@@ -96,6 +96,7 @@

     /** Prints the given <code>JimpleBody</code> to the specified <code>PrintWriter</code>. */
     private void printStatementsInBody(Body body, java.io.PrintWriter out) {
+        LabeledUnitPrinter up = new NormalUnitPrinter(body);
         Chain units = body.getUnits();

         Map stmtToName = new HashMap(units.size() * 2 + 1, 0.7f);
@@ -448,7 +449,8 @@
             }

             // parse any info from the statement code
-            String jimpleStr = currentStmt.toString().trim();
+            currentStmt.toString(up);
+            String jimpleStr = up.toString().trim();
             if (currentStmt instanceof soot.jimple.IdentityStmt &&
                jimpleStr.indexOf("@parameter") != -1) {
                 // this line is a use of a parameter