Thread: [Dashg-commit] SF.net SVN: dashg:[11] trunk/dashg/src/com/mebigfatguy/dashg
Status: Pre-Alpha
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2008-10-25 07:05:33
|
Revision: 11
http://dashg.svn.sourceforge.net/dashg/?rev=11&view=rev
Author: dbrosius
Date: 2008-10-25 07:05:27 +0000 (Sat, 25 Oct 2008)
Log Message:
-----------
handle arrays and ctors
Modified Paths:
--------------
trunk/dashg/src/com/mebigfatguy/dashg/DashGClassAdapter.java
trunk/dashg/src/com/mebigfatguy/dashg/DashGTask.java
Modified: trunk/dashg/src/com/mebigfatguy/dashg/DashGClassAdapter.java
===================================================================
--- trunk/dashg/src/com/mebigfatguy/dashg/DashGClassAdapter.java 2008-10-25 06:43:53 UTC (rev 10)
+++ trunk/dashg/src/com/mebigfatguy/dashg/DashGClassAdapter.java 2008-10-25 07:05:27 UTC (rev 11)
@@ -29,13 +29,13 @@
public class DashGClassAdapter extends ClassAdapter {
- private final String fullPackageName;
+ private final String className;
private final Map<String, Map<Integer, Integer>> methodOffsets;
- private final Pattern parmsPattern = Pattern.compile("([IJFDBCZS]|L[^;]*;)");
+ private final Pattern parmsPattern = Pattern.compile("(\\[*)([IJFDBCZS]|L[^;]*;)");
- public DashGClassAdapter(ClassVisitor visitor, String fileName, String packageName, Map<String, Map<Integer, Integer>> offsets) {
+ public DashGClassAdapter(ClassVisitor visitor, String fileName, String clsName, Map<String, Map<Integer, Integer>> offsets) {
super(visitor);
- fullPackageName = packageName;
+ className = clsName;
methodOffsets = offsets;
super.visitSource(fileName, null);
}
@@ -63,7 +63,7 @@
StringBuilder sb = new StringBuilder(name.length() + parm.length());
if ("<init>".equals(name)) {
- name = fullPackageName;
+ name = className;
}
sb.append(name);
sb.append("(");
@@ -74,7 +74,8 @@
sb.append(comma);
comma = ", ";
- String type = m.group(1);
+ String arraySpec = m.group(1);
+ String type = m.group(2);
if (type.startsWith("L")) {
type = type.substring(1, type.length() - 1);
type = type.replace('/', '.');
@@ -96,6 +97,9 @@
type = "short";
}
sb.append(type);
+ for (int i = 0; i < arraySpec.length(); i++) {
+ sb.append("[]");
+ }
}
sb.append(")");
Modified: trunk/dashg/src/com/mebigfatguy/dashg/DashGTask.java
===================================================================
--- trunk/dashg/src/com/mebigfatguy/dashg/DashGTask.java 2008-10-25 06:43:53 UTC (rev 10)
+++ trunk/dashg/src/com/mebigfatguy/dashg/DashGTask.java 2008-10-25 07:05:27 UTC (rev 11)
@@ -106,7 +106,7 @@
parseJavaPFile(p.getInputStream(), destSrcFile, packageName, fileBaseName);
p.waitFor();
- buildNewClass(new File(baseDirectory, fName), dstClsFile, fileBaseName + ".java", packageName + "." + fileBaseName);
+ buildNewClass(new File(baseDirectory, fName), dstClsFile, fileBaseName + ".java", packageName + "." + fileBaseName, fileBaseName);
} catch (Exception ioe) {
throw new BuildException("Failed generating output files for file " + fName, ioe);
}
@@ -174,7 +174,7 @@
}
}
- public void buildNewClass(File inputClass, File outputClass, String sourceName, String packageName) throws IOException {
+ public void buildNewClass(File inputClass, File outputClass, String sourceName, String packageName, String className) throws IOException {
BufferedInputStream bis = null;
BufferedOutputStream bos = null;
@@ -182,7 +182,7 @@
bis = new BufferedInputStream(new FileInputStream(inputClass));
ClassReader cr = new ClassReader(bis);
ClassWriter cw = new ClassWriter(cr, ClassWriter.COMPUTE_MAXS);
- ClassAdapter ca = new DashGClassAdapter(cw, sourceName, packageName, methodOffsets);
+ ClassAdapter ca = new DashGClassAdapter(cw, sourceName, className, methodOffsets);
cr.accept(ca, 0);
byte[] classData = cw.toByteArray();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-10-25 07:26:32
|
Revision: 12
http://dashg.svn.sourceforge.net/dashg/?rev=12&view=rev
Author: dbrosius
Date: 2008-10-25 07:26:30 +0000 (Sat, 25 Oct 2008)
Log Message:
-----------
better byte offset to line calculations
Modified Paths:
--------------
trunk/dashg/src/com/mebigfatguy/dashg/DashGMethodAdapter.java
trunk/dashg/src/com/mebigfatguy/dashg/DashGTask.java
Modified: trunk/dashg/src/com/mebigfatguy/dashg/DashGMethodAdapter.java
===================================================================
--- trunk/dashg/src/com/mebigfatguy/dashg/DashGMethodAdapter.java 2008-10-25 07:05:27 UTC (rev 11)
+++ trunk/dashg/src/com/mebigfatguy/dashg/DashGMethodAdapter.java 2008-10-25 07:26:30 UTC (rev 12)
@@ -18,10 +18,8 @@
*/
package com.mebigfatguy.dashg;
-import java.util.Iterator;
import java.util.Map;
-import org.apache.tools.ant.BuildException;
import org.objectweb.asm.Label;
import org.objectweb.asm.MethodAdapter;
import org.objectweb.asm.MethodVisitor;
@@ -29,14 +27,12 @@
public class DashGMethodAdapter extends MethodAdapter {
Map<Integer, Integer> lineOffsets;
- Iterator<Integer> lineIt;
String methodName;
public DashGMethodAdapter(MethodVisitor mv, String name, Map<Integer, Integer> offsets) {
super(mv);
lineOffsets = offsets;
methodName = name;
- lineIt = lineOffsets.keySet().iterator();
}
@Override
@@ -116,11 +112,10 @@
}
private void addLine() {
- if (lineIt.hasNext()) {
- Label l = new Label();
- super.visitLabel(l);
- super.visitLineNumber(lineIt.next().intValue(), l);
- } else
- throw new BuildException("Prematurely ran out of line numbers for method " + methodName);
+ Label l = new Label();
+ super.visitLabel(l);
+ Integer srcLine = lineOffsets.get(Integer.valueOf(l.getOffset()));
+ if (srcLine != null)
+ super.visitLineNumber(srcLine.intValue(), l);
}
}
Modified: trunk/dashg/src/com/mebigfatguy/dashg/DashGTask.java
===================================================================
--- trunk/dashg/src/com/mebigfatguy/dashg/DashGTask.java 2008-10-25 07:05:27 UTC (rev 11)
+++ trunk/dashg/src/com/mebigfatguy/dashg/DashGTask.java 2008-10-25 07:26:30 UTC (rev 12)
@@ -116,7 +116,7 @@
PrintWriter pw = null;
Map<Integer, Integer> offsets = null;
- Pattern methodPattern = Pattern.compile("(public|private|protected)?\\s*[a-zA-Z0-9<>?]*\\s*[a-zA-Z0-9]*\\([^\\)]*\\)[^;]*;");
+ Pattern methodPattern = Pattern.compile("(public|private|protected)?\\s*(static\\s*)?[a-zA-Z0-9<>?]*\\s*[a-zA-Z0-9]*\\([^\\)]*\\)[^;]*;");
Pattern linePattern = Pattern.compile("\\s*([0-9]*):.*");
Pattern simpleNameSigPattern = Pattern.compile("\\s([^\\s(]*\\([^)]*\\))");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-10-25 14:19:57
|
Revision: 13
http://dashg.svn.sourceforge.net/dashg/?rev=13&view=rev
Author: dbrosius
Date: 2008-10-25 14:19:54 +0000 (Sat, 25 Oct 2008)
Log Message:
-----------
fix differences in ctors between javap and asm
Modified Paths:
--------------
trunk/dashg/src/com/mebigfatguy/dashg/DashGClassAdapter.java
trunk/dashg/src/com/mebigfatguy/dashg/DashGTask.java
Modified: trunk/dashg/src/com/mebigfatguy/dashg/DashGClassAdapter.java
===================================================================
--- trunk/dashg/src/com/mebigfatguy/dashg/DashGClassAdapter.java 2008-10-25 07:26:30 UTC (rev 12)
+++ trunk/dashg/src/com/mebigfatguy/dashg/DashGClassAdapter.java 2008-10-25 14:19:54 UTC (rev 13)
@@ -29,12 +29,14 @@
public class DashGClassAdapter extends ClassAdapter {
+ private final String fullyQualifiedName;
private final String className;
private final Map<String, Map<Integer, Integer>> methodOffsets;
private final Pattern parmsPattern = Pattern.compile("(\\[*)([IJFDBCZS]|L[^;]*;)");
- public DashGClassAdapter(ClassVisitor visitor, String fileName, String clsName, Map<String, Map<Integer, Integer>> offsets) {
+ public DashGClassAdapter(ClassVisitor visitor, String fileName, String fqn, String clsName, Map<String, Map<Integer, Integer>> offsets) {
super(visitor);
+ fullyQualifiedName = fqn;
className = clsName;
methodOffsets = offsets;
super.visitSource(fileName, null);
@@ -46,6 +48,9 @@
@Override
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
+ if (name.equals("<clinit>"))
+ return super.visitMethod(access, name, desc, signature, exceptions);
+
String nameSig = buildNameParmSig(name, desc);
Map<Integer, Integer> offsets = methodOffsets.get(nameSig);
MethodVisitor mv = super.visitMethod(access, name, desc, signature, exceptions);
@@ -63,7 +68,7 @@
StringBuilder sb = new StringBuilder(name.length() + parm.length());
if ("<init>".equals(name)) {
- name = className;
+ name = fullyQualifiedName;
}
sb.append(name);
sb.append("(");
Modified: trunk/dashg/src/com/mebigfatguy/dashg/DashGTask.java
===================================================================
--- trunk/dashg/src/com/mebigfatguy/dashg/DashGTask.java 2008-10-25 07:26:30 UTC (rev 12)
+++ trunk/dashg/src/com/mebigfatguy/dashg/DashGTask.java 2008-10-25 14:19:54 UTC (rev 13)
@@ -72,6 +72,7 @@
DirectoryScanner ds = classSource.getDirectoryScanner();
String[] files = ds.getIncludedFiles();
for (String fName : files) {
+ methodOffsets.clear();
if (!fName.endsWith(".class"))
continue;
generateDashGFiles(ds.getBasedir(), fName);
@@ -106,7 +107,7 @@
parseJavaPFile(p.getInputStream(), destSrcFile, packageName, fileBaseName);
p.waitFor();
- buildNewClass(new File(baseDirectory, fName), dstClsFile, fileBaseName + ".java", packageName + "." + fileBaseName, fileBaseName);
+ buildNewClass(new File(baseDirectory, fName), dstClsFile, fileBaseName + ".java", (packageName == null) ? fileBaseName : packageName + "." + fileBaseName, fileBaseName);
} catch (Exception ioe) {
throw new BuildException("Failed generating output files for file " + fName, ioe);
}
@@ -116,7 +117,7 @@
PrintWriter pw = null;
Map<Integer, Integer> offsets = null;
- Pattern methodPattern = Pattern.compile("(public|private|protected)?\\s*(static\\s*)?[a-zA-Z0-9<>?]*\\s*[a-zA-Z0-9]*\\([^\\)]*\\)[^;]*;");
+ Pattern methodPattern = Pattern.compile("(public|private|protected)?\\s*(static\\s*)?[a-zA-Z0-9.<>?]*\\s*[a-zA-Z0-9]*\\([^\\)]*\\)[^;]*;");
Pattern linePattern = Pattern.compile("\\s*([0-9]*):.*");
Pattern simpleNameSigPattern = Pattern.compile("\\s([^\\s(]*\\([^)]*\\))");
@@ -174,7 +175,7 @@
}
}
- public void buildNewClass(File inputClass, File outputClass, String sourceName, String packageName, String className) throws IOException {
+ public void buildNewClass(File inputClass, File outputClass, String sourceName, String fqn, String className) throws IOException {
BufferedInputStream bis = null;
BufferedOutputStream bos = null;
@@ -182,7 +183,7 @@
bis = new BufferedInputStream(new FileInputStream(inputClass));
ClassReader cr = new ClassReader(bis);
ClassWriter cw = new ClassWriter(cr, ClassWriter.COMPUTE_MAXS);
- ClassAdapter ca = new DashGClassAdapter(cw, sourceName, className, methodOffsets);
+ ClassAdapter ca = new DashGClassAdapter(cw, sourceName, fqn, className, methodOffsets);
cr.accept(ca, 0);
byte[] classData = cw.toByteArray();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-10-25 21:14:07
|
Revision: 15
http://dashg.svn.sourceforge.net/dashg/?rev=15&view=rev
Author: dbrosius
Date: 2008-10-25 21:14:02 +0000 (Sat, 25 Oct 2008)
Log Message:
-----------
remove unused
Modified Paths:
--------------
trunk/dashg/src/com/mebigfatguy/dashg/DashGClassAdapter.java
trunk/dashg/src/com/mebigfatguy/dashg/DashGTask.java
Modified: trunk/dashg/src/com/mebigfatguy/dashg/DashGClassAdapter.java
===================================================================
--- trunk/dashg/src/com/mebigfatguy/dashg/DashGClassAdapter.java 2008-10-25 14:29:48 UTC (rev 14)
+++ trunk/dashg/src/com/mebigfatguy/dashg/DashGClassAdapter.java 2008-10-25 21:14:02 UTC (rev 15)
@@ -30,14 +30,12 @@
public class DashGClassAdapter extends ClassAdapter {
private final String fullyQualifiedName;
- private final String className;
private final Map<String, Map<Integer, Integer>> methodOffsets;
private final Pattern parmsPattern = Pattern.compile("(\\[*)([IJFDBCZS]|L[^;]*;)");
- public DashGClassAdapter(ClassVisitor visitor, String fileName, String fqn, String clsName, Map<String, Map<Integer, Integer>> offsets) {
+ public DashGClassAdapter(ClassVisitor visitor, String fileName, String fqn, Map<String, Map<Integer, Integer>> offsets) {
super(visitor);
fullyQualifiedName = fqn;
- className = clsName;
methodOffsets = offsets;
super.visitSource(fileName, null);
}
Modified: trunk/dashg/src/com/mebigfatguy/dashg/DashGTask.java
===================================================================
--- trunk/dashg/src/com/mebigfatguy/dashg/DashGTask.java 2008-10-25 14:29:48 UTC (rev 14)
+++ trunk/dashg/src/com/mebigfatguy/dashg/DashGTask.java 2008-10-25 21:14:02 UTC (rev 15)
@@ -41,6 +41,7 @@
import org.objectweb.asm.ClassAdapter;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassWriter;
+import org.objectweb.asm.util.TraceClassVisitor;
public class DashGTask extends Task {
@@ -107,7 +108,7 @@
parseJavaPFile(p.getInputStream(), destSrcFile, packageName, fileBaseName);
p.waitFor();
- buildNewClass(new File(baseDirectory, fName), dstClsFile, fileBaseName + ".java", (packageName == null) ? fileBaseName : packageName + "." + fileBaseName, fileBaseName);
+ buildNewClass(new File(baseDirectory, fName), dstClsFile, fileBaseName + ".java", (packageName == null) ? fileBaseName : packageName + "." + fileBaseName);
} catch (Exception ioe) {
throw new BuildException("Failed generating output files for file " + fName, ioe);
}
@@ -175,7 +176,7 @@
}
}
- public void buildNewClass(File inputClass, File outputClass, String sourceName, String fqn, String className) throws IOException {
+ public void buildNewClass(File inputClass, File outputClass, String sourceName, String fqn) throws IOException {
BufferedInputStream bis = null;
BufferedOutputStream bos = null;
@@ -183,7 +184,7 @@
bis = new BufferedInputStream(new FileInputStream(inputClass));
ClassReader cr = new ClassReader(bis);
ClassWriter cw = new ClassWriter(cr, ClassWriter.COMPUTE_MAXS);
- ClassAdapter ca = new DashGClassAdapter(cw, sourceName, fqn, className, methodOffsets);
+ ClassAdapter ca = new DashGClassAdapter(new TraceClassVisitor(cw, new PrintWriter(System.err)), sourceName, fqn, methodOffsets);
cr.accept(ca, 0);
byte[] classData = cw.toByteArray();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-10-28 17:27:11
|
Revision: 25
http://dashg.svn.sourceforge.net/dashg/?rev=25&view=rev
Author: dbrosius
Date: 2008-10-28 17:27:06 +0000 (Tue, 28 Oct 2008)
Log Message:
-----------
get rid of old lineOffsets method of getting source lines (to be replaced with DashGSourceWriter interface
Modified Paths:
--------------
trunk/dashg/src/com/mebigfatguy/dashg/DashGClassAdapter.java
trunk/dashg/src/com/mebigfatguy/dashg/DashGMethodAdapter.java
trunk/dashg/src/com/mebigfatguy/dashg/DashGTask.java
Modified: trunk/dashg/src/com/mebigfatguy/dashg/DashGClassAdapter.java
===================================================================
--- trunk/dashg/src/com/mebigfatguy/dashg/DashGClassAdapter.java 2008-10-28 17:22:58 UTC (rev 24)
+++ trunk/dashg/src/com/mebigfatguy/dashg/DashGClassAdapter.java 2008-10-28 17:27:06 UTC (rev 25)
@@ -18,10 +18,6 @@
*/
package com.mebigfatguy.dashg;
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
import org.objectweb.asm.ClassAdapter;
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.MethodVisitor;
@@ -29,14 +25,8 @@
public class DashGClassAdapter extends ClassAdapter {
- private final String fullyQualifiedName;
- private final Map<String, Map<Integer, Integer>> methodOffsets;
- private final Pattern parmsPattern = Pattern.compile("(\\[*)([IJFDBCZS]|L[^;]*;)");
-
- public DashGClassAdapter(ClassVisitor visitor, String fileName, String fqn, Map<String, Map<Integer, Integer>> offsets) {
+ public DashGClassAdapter(ClassVisitor visitor, String fileName) {
super(visitor);
- fullyQualifiedName = fqn;
- methodOffsets = offsets;
super.visitSource(fileName, null);
}
@@ -49,64 +39,7 @@
if (name.equals("<clinit>"))
return super.visitMethod(access, name, desc, signature, exceptions);
- String nameSig = buildNameParmSig(name, desc);
- Map<Integer, Integer> offsets = methodOffsets.get(nameSig);
MethodVisitor mv = super.visitMethod(access, name, desc, signature, exceptions);
-
- if (offsets != null)
- return new DashGMethodAdapter(mv, name+desc, offsets);
- else
- return mv;
+ return new DashGMethodAdapter(mv, name+desc);
}
-
- private String buildNameParmSig(String name, String parm) {
- parm = parm.substring(1);
- int lParenPos = parm.lastIndexOf(')');
- parm = parm.substring(0, lParenPos);
-
- StringBuilder sb = new StringBuilder(name.length() + parm.length());
- if ("<init>".equals(name)) {
- name = fullyQualifiedName;
- }
- sb.append(name);
- sb.append("(");
-
- Matcher m = parmsPattern.matcher(parm);
- String comma = "";
- while (m.find()) {
- sb.append(comma);
- comma = ", ";
-
- String arraySpec = m.group(1);
- String type = m.group(2);
- if (type.startsWith("L")) {
- type = type.substring(1, type.length() - 1);
- type = type.replace('/', '.');
- } else if ("I".equals(type)) {
- type = "int";
- } else if ("J".equals(type)) {
- type = "long";
- } else if ("F".equals(type)) {
- type = "float";
- } else if ("D".equals(type)) {
- type = "double";
- } else if ("C".equals(type)) {
- type = "char";
- } else if ("B".equals(type)) {
- type = "byte";
- } else if ("Z".equals(type)) {
- type = "boolean";
- } else if ("S".equals(type)) {
- type = "short";
- }
- sb.append(type);
- for (int i = 0; i < arraySpec.length(); i++) {
- sb.append("[]");
- }
- }
-
- sb.append(")");
- return sb.toString();
- }
-
}
Modified: trunk/dashg/src/com/mebigfatguy/dashg/DashGMethodAdapter.java
===================================================================
--- trunk/dashg/src/com/mebigfatguy/dashg/DashGMethodAdapter.java 2008-10-28 17:22:58 UTC (rev 24)
+++ trunk/dashg/src/com/mebigfatguy/dashg/DashGMethodAdapter.java 2008-10-28 17:27:06 UTC (rev 25)
@@ -18,20 +18,16 @@
*/
package com.mebigfatguy.dashg;
-import java.util.Map;
-
import org.objectweb.asm.Label;
import org.objectweb.asm.MethodAdapter;
import org.objectweb.asm.MethodVisitor;
public class DashGMethodAdapter extends MethodAdapter {
- Map<Integer, Integer> lineOffsets;
String methodName;
- public DashGMethodAdapter(MethodVisitor mv, String name, Map<Integer, Integer> offsets) {
+ public DashGMethodAdapter(MethodVisitor mv, String name) {
super(mv);
- lineOffsets = offsets;
methodName = name;
}
@@ -114,7 +110,7 @@
private void addLine() {
Label l = new Label();
super.visitLabel(l);
- Integer srcLine = lineOffsets.get(Integer.valueOf(l.getOffset()));
+ Integer srcLine = Integer.valueOf(0);
if (srcLine != null)
super.visitLineNumber(srcLine.intValue(), l);
}
Modified: trunk/dashg/src/com/mebigfatguy/dashg/DashGTask.java
===================================================================
--- trunk/dashg/src/com/mebigfatguy/dashg/DashGTask.java 2008-10-28 17:22:58 UTC (rev 24)
+++ trunk/dashg/src/com/mebigfatguy/dashg/DashGTask.java 2008-10-28 17:27:06 UTC (rev 25)
@@ -110,13 +110,12 @@
PrintWriter pw = null;
try {
- String fqn = (packageName != null) ? (packageName + '.' + baseName) : baseName;
bis = new BufferedInputStream(new FileInputStream(inputClass));
pw = new PrintWriter(new BufferedWriter(new FileWriter(outputSrc)));
ClassReader cr = new ClassReader(bis);
ClassWriter cw = new ClassWriter(cr, ClassWriter.COMPUTE_MAXS);
- ClassAdapter ca = new DashGClassAdapter(new TraceClassVisitor(cw, new DashGSourceWriter(pw, packageName)), baseName, fqn, methodOffsets);
+ ClassAdapter ca = new DashGClassAdapter(new TraceClassVisitor(cw, new DashGSourceWriter(pw, packageName)), baseName);
cr.accept(ca, 0);
byte[] classData = cw.toByteArray();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-10-28 17:40:25
|
Revision: 28
http://dashg.svn.sourceforge.net/dashg/?rev=28&view=rev
Author: dbrosius
Date: 2008-10-28 17:40:18 +0000 (Tue, 28 Oct 2008)
Log Message:
-----------
strip the offsets stuff, in lieu of moving to asm
Modified Paths:
--------------
trunk/dashg/src/com/mebigfatguy/dashg/DashGClassAdapter.java
trunk/dashg/src/com/mebigfatguy/dashg/DashGMethodAdapter.java
trunk/dashg/src/com/mebigfatguy/dashg/DashGTask.java
Modified: trunk/dashg/src/com/mebigfatguy/dashg/DashGClassAdapter.java
===================================================================
--- trunk/dashg/src/com/mebigfatguy/dashg/DashGClassAdapter.java 2008-10-28 17:29:39 UTC (rev 27)
+++ trunk/dashg/src/com/mebigfatguy/dashg/DashGClassAdapter.java 2008-10-28 17:40:18 UTC (rev 28)
@@ -25,9 +25,12 @@
public class DashGClassAdapter extends ClassAdapter {
- public DashGClassAdapter(ClassVisitor visitor, String fileName) {
+ private DashGLineNumberer lineNumberer;
+
+ public DashGClassAdapter(ClassVisitor visitor, DashGLineNumberer ln, String fileName) {
super(visitor);
super.visitSource(fileName, null);
+ lineNumberer = ln;
}
@Override
@@ -40,6 +43,6 @@
return super.visitMethod(access, name, desc, signature, exceptions);
MethodVisitor mv = super.visitMethod(access, name, desc, signature, exceptions);
- return new DashGMethodAdapter(mv, name+desc);
+ return new DashGMethodAdapter(mv, lineNumberer, name+desc);
}
}
Modified: trunk/dashg/src/com/mebigfatguy/dashg/DashGMethodAdapter.java
===================================================================
--- trunk/dashg/src/com/mebigfatguy/dashg/DashGMethodAdapter.java 2008-10-28 17:29:39 UTC (rev 27)
+++ trunk/dashg/src/com/mebigfatguy/dashg/DashGMethodAdapter.java 2008-10-28 17:40:18 UTC (rev 28)
@@ -24,10 +24,12 @@
public class DashGMethodAdapter extends MethodAdapter {
+ DashGLineNumberer lineNumberer;
String methodName;
- public DashGMethodAdapter(MethodVisitor mv, String name) {
+ public DashGMethodAdapter(MethodVisitor mv, DashGLineNumberer ln, String name) {
super(mv);
+ lineNumberer = ln;
methodName = name;
}
@@ -110,8 +112,6 @@
private void addLine() {
Label l = new Label();
super.visitLabel(l);
- Integer srcLine = Integer.valueOf(0);
- if (srcLine != null)
- super.visitLineNumber(srcLine.intValue(), l);
+ super.visitLineNumber(lineNumberer.getLineNumber(), l);
}
}
Modified: trunk/dashg/src/com/mebigfatguy/dashg/DashGTask.java
===================================================================
--- trunk/dashg/src/com/mebigfatguy/dashg/DashGTask.java 2008-10-28 17:29:39 UTC (rev 27)
+++ trunk/dashg/src/com/mebigfatguy/dashg/DashGTask.java 2008-10-28 17:40:18 UTC (rev 28)
@@ -115,7 +115,8 @@
ClassReader cr = new ClassReader(bis);
ClassWriter cw = new ClassWriter(cr, ClassWriter.COMPUTE_MAXS);
- ClassAdapter ca = new DashGClassAdapter(new TraceClassVisitor(cw, new DashGSourceWriter(pw, packageName)), baseName);
+ DashGSourceWriter sw = new DashGSourceWriter(pw, packageName);
+ ClassAdapter ca = new DashGClassAdapter(new TraceClassVisitor(cw, sw), sw, baseName);
cr.accept(ca, 0);
byte[] classData = cw.toByteArray();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-10-28 18:12:11
|
Revision: 29
http://dashg.svn.sourceforge.net/dashg/?rev=29&view=rev
Author: dbrosius
Date: 2008-10-28 18:12:04 +0000 (Tue, 28 Oct 2008)
Log Message:
-----------
Move in another direction, TraceClassVisitor caches output, which wrecks the notion that we can use it to get line numbers
Added Paths:
-----------
trunk/dashg/src/com/mebigfatguy/dashg/DashGClassSourcePrintingVisitor.java
trunk/dashg/src/com/mebigfatguy/dashg/DashGMethodSourcePrintingVisitor.java
Added: trunk/dashg/src/com/mebigfatguy/dashg/DashGClassSourcePrintingVisitor.java
===================================================================
--- trunk/dashg/src/com/mebigfatguy/dashg/DashGClassSourcePrintingVisitor.java (rev 0)
+++ trunk/dashg/src/com/mebigfatguy/dashg/DashGClassSourcePrintingVisitor.java 2008-10-28 18:12:04 UTC (rev 29)
@@ -0,0 +1,127 @@
+/*
+ * dashg - A debug symbols (-g) injector
+ * Copyright (C) 2008 Dave Brosius
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+package com.mebigfatguy.dashg;
+
+import java.io.PrintWriter;
+
+import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.Attribute;
+import org.objectweb.asm.ClassVisitor;
+import org.objectweb.asm.ClassWriter;
+import org.objectweb.asm.FieldVisitor;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
+
+public class DashGClassSourcePrintingVisitor implements ClassVisitor, DashGLineNumberer {
+
+ private ClassWriter cw;
+ private PrintWriter pw;
+ private String packageName;
+ private String clsName;
+ private int lineNumber = 1;
+
+ public DashGClassSourcePrintingVisitor(ClassWriter classWriter, PrintWriter srcWriter) {
+ cw = classWriter;
+ pw = srcWriter;
+ }
+
+ public int getLineNumber() {
+ return lineNumber;
+ }
+
+ public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
+ int dotPos = name.lastIndexOf('.');
+ if (dotPos >= 0) {
+ packageName = name.substring(0, dotPos);
+ clsName = name.substring(dotPos+1);
+
+ pw.println("package " + packageName + ";");
+ pw.println();
+
+ lineNumber += 2;
+ } else {
+ packageName = null;
+ clsName = name;
+ }
+
+ if ((access & Opcodes.ACC_PUBLIC) != 0) {
+ pw.print("public ");
+ } else if ((access & Opcodes.ACC_PRIVATE) != 0) {
+ pw.print("private ");
+ } else if ((access & Opcodes.ACC_PROTECTED) != 0) {
+ pw.print("protected ");
+ }
+
+ if ((access & Opcodes.ACC_STATIC) != 0) {
+ pw.println("static ");
+ } else if ((access & Opcodes.ACC_ABSTRACT) != 0) {
+ pw.print("abstract ");
+ }
+
+ if ((access & Opcodes.ACC_FINAL) != 0) {
+ pw.print("final ");
+ }
+
+ pw.print(clsName + ' ');
+
+ if (superName != null)
+ pw.print("extends " + superName + ' ');
+
+ String comma = "implements ";
+ for (String inf : interfaces) {
+ pw.print(comma);
+ comma = ", ";
+ pw.print(inf);
+ }
+
+ pw.println();
+
+ lineNumber+=1;
+
+ cw.visit(version, access, name, signature, superName, interfaces);
+ }
+
+ public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
+ return null;
+ }
+
+ public void visitAttribute(Attribute attr) {
+ }
+
+ public void visitEnd() {
+ }
+
+ public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) {
+ return null;
+ }
+
+ public void visitInnerClass(String name, String outerName, String innerName, int access) {
+ }
+
+ public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
+ return new DashGMethodSourcePrintingVisitor(cw, pw);
+ }
+
+ public void visitOuterClass(String owner, String name, String desc) {
+ }
+
+ public void visitSource(String source, String debug) {
+ }
+
+}
Property changes on: trunk/dashg/src/com/mebigfatguy/dashg/DashGClassSourcePrintingVisitor.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ native
Added: trunk/dashg/src/com/mebigfatguy/dashg/DashGMethodSourcePrintingVisitor.java
===================================================================
--- trunk/dashg/src/com/mebigfatguy/dashg/DashGMethodSourcePrintingVisitor.java (rev 0)
+++ trunk/dashg/src/com/mebigfatguy/dashg/DashGMethodSourcePrintingVisitor.java 2008-10-28 18:12:04 UTC (rev 29)
@@ -0,0 +1,119 @@
+/*
+ * dashg - A debug symbols (-g) injector
+ * Copyright (C) 2008 Dave Brosius
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+package com.mebigfatguy.dashg;
+
+import java.io.PrintWriter;
+
+import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.Attribute;
+import org.objectweb.asm.ClassWriter;
+import org.objectweb.asm.Label;
+import org.objectweb.asm.MethodVisitor;
+
+public class DashGMethodSourcePrintingVisitor implements MethodVisitor {
+
+ private ClassWriter cw;
+ private PrintWriter pw;
+
+ public DashGMethodSourcePrintingVisitor(ClassWriter cWriter, PrintWriter pWriter) {
+ cw = cWriter;
+ pw = pWriter;
+ }
+
+ public AnnotationVisitor visitAnnotation(String arg0, boolean arg1) {
+ return null;
+ }
+
+ public AnnotationVisitor visitAnnotationDefault() {
+ return null;
+ }
+
+ public void visitAttribute(Attribute arg0) {
+ }
+
+ public void visitCode() {
+ }
+
+ public void visitEnd() {
+ }
+
+ public void visitFieldInsn(int arg0, String arg1, String arg2, String arg3) {
+
+ }
+
+ public void visitFrame(int arg0, int arg1, Object[] arg2, int arg3,
+ Object[] arg4) {
+ }
+
+ public void visitIincInsn(int arg0, int arg1) {
+ }
+
+ public void visitInsn(int arg0) {
+ }
+
+ public void visitIntInsn(int arg0, int arg1) {
+ }
+
+ public void visitJumpInsn(int arg0, Label arg1) {
+ }
+
+ public void visitLabel(Label arg0) {
+ }
+
+ public void visitLdcInsn(Object arg0) {
+ }
+
+ public void visitLineNumber(int arg0, Label arg1) {
+ }
+
+ public void visitLocalVariable(String arg0, String arg1, String arg2,
+ Label arg3, Label arg4, int arg5) {
+ }
+
+ public void visitLookupSwitchInsn(Label arg0, int[] arg1, Label[] arg2) {
+ }
+
+ public void visitMaxs(int arg0, int arg1) {
+ }
+
+ public void visitMethodInsn(int arg0, String arg1, String arg2, String arg3) {
+ }
+
+ public void visitMultiANewArrayInsn(String arg0, int arg1) {
+ }
+
+ public AnnotationVisitor visitParameterAnnotation(int arg0, String arg1,
+ boolean arg2) {
+ return null;
+ }
+
+ public void visitTableSwitchInsn(int arg0, int arg1, Label arg2,
+ Label[] arg3) {
+ }
+
+ public void visitTryCatchBlock(Label arg0, Label arg1, Label arg2,
+ String arg3) {
+ }
+
+ public void visitTypeInsn(int arg0, String arg1) {
+ }
+
+ public void visitVarInsn(int arg0, int arg1) {
+ }
+}
Property changes on: trunk/dashg/src/com/mebigfatguy/dashg/DashGMethodSourcePrintingVisitor.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-10-28 19:25:20
|
Revision: 31
http://dashg.svn.sourceforge.net/dashg/?rev=31&view=rev
Author: dbrosius
Date: 2008-10-28 19:25:16 +0000 (Tue, 28 Oct 2008)
Log Message:
-----------
start using ASM to build src files
Modified Paths:
--------------
trunk/dashg/src/com/mebigfatguy/dashg/DashGClassSourcePrintingVisitor.java
trunk/dashg/src/com/mebigfatguy/dashg/DashGLineNumberer.java
trunk/dashg/src/com/mebigfatguy/dashg/DashGMethodSourcePrintingVisitor.java
trunk/dashg/src/com/mebigfatguy/dashg/DashGTask.java
Removed Paths:
-------------
trunk/dashg/src/com/mebigfatguy/dashg/DashGSourceWriter.java
Modified: trunk/dashg/src/com/mebigfatguy/dashg/DashGClassSourcePrintingVisitor.java
===================================================================
--- trunk/dashg/src/com/mebigfatguy/dashg/DashGClassSourcePrintingVisitor.java 2008-10-28 19:24:51 UTC (rev 30)
+++ trunk/dashg/src/com/mebigfatguy/dashg/DashGClassSourcePrintingVisitor.java 2008-10-28 19:25:16 UTC (rev 31)
@@ -19,6 +19,7 @@
package com.mebigfatguy.dashg;
import java.io.PrintWriter;
+import java.util.List;
import org.objectweb.asm.AnnotationVisitor;
import org.objectweb.asm.Attribute;
@@ -26,7 +27,6 @@
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.FieldVisitor;
import org.objectweb.asm.MethodVisitor;
-import org.objectweb.asm.Opcodes;
public class DashGClassSourcePrintingVisitor implements ClassVisitor, DashGLineNumberer {
@@ -41,15 +41,22 @@
pw = srcWriter;
}
+ public void inc() {
+ ++lineNumber;
+ }
+
+ public void inc(int count) {
+ lineNumber += count;
+ }
public int getLineNumber() {
return lineNumber;
}
public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
- int dotPos = name.lastIndexOf('.');
- if (dotPos >= 0) {
- packageName = name.substring(0, dotPos);
- clsName = name.substring(dotPos+1);
+ int slashPos = name.lastIndexOf('/');
+ if (slashPos >= 0) {
+ packageName = name.substring(0, slashPos).replace('/', '.');
+ clsName = name.substring(slashPos+1);
pw.println("package " + packageName + ";");
pw.println();
@@ -60,28 +67,12 @@
clsName = name;
}
- if ((access & Opcodes.ACC_PUBLIC) != 0) {
- pw.print("public ");
- } else if ((access & Opcodes.ACC_PRIVATE) != 0) {
- pw.print("private ");
- } else if ((access & Opcodes.ACC_PROTECTED) != 0) {
- pw.print("protected ");
- }
+ pw.print(DashGUtils.getAttribute(access));
- if ((access & Opcodes.ACC_STATIC) != 0) {
- pw.println("static ");
- } else if ((access & Opcodes.ACC_ABSTRACT) != 0) {
- pw.print("abstract ");
- }
-
- if ((access & Opcodes.ACC_FINAL) != 0) {
- pw.print("final ");
- }
-
pw.print(clsName + ' ');
- if (superName != null)
- pw.print("extends " + superName + ' ');
+ if (!superName.equals("java/lang/Object"))
+ pw.print("extends " + superName.replace('/', '.') + ' ');
String comma = "implements ";
for (String inf : interfaces) {
@@ -90,9 +81,9 @@
pw.print(inf);
}
- pw.println();
+ pw.println(" {");
- lineNumber+=1;
+ ++lineNumber;
cw.visit(version, access, name, signature, superName, interfaces);
}
@@ -105,9 +96,19 @@
}
public void visitEnd() {
+ pw.println("}");
+ ++lineNumber;
}
public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) {
+ pw.print('\t' + DashGUtils.getAttribute(access));
+ String type = DashGUtils.convertType(desc);
+ pw.print(type + ' ' + name);
+ if (value != null)
+ pw.print(" = " + value);
+ pw.println(";");
+ ++lineNumber;
+
return null;
}
@@ -115,7 +116,30 @@
}
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
- return new DashGMethodSourcePrintingVisitor(cw, pw);
+ pw.println();
+ pw.print('\t' + DashGUtils.getAttribute(access));
+ pw.print(DashGUtils.getReturn(desc));
+ pw.print(' ');
+ if (name.equals("<init>"))
+ name = clsName;
+ pw.print(name);
+ List<String> args = DashGUtils.getArguments(desc);
+ String comma = "(";
+ for (String a : args) {
+ pw.print(comma);
+ comma = ", ";
+ pw.print(a);
+ pw.print(' ');
+ pw.print('x');
+ }
+ pw.print(") ");
+
+ pw.println("{");
+ pw.println("\t\tint PC;");
+ pw.println();
+ lineNumber += 4;
+
+ return new DashGMethodSourcePrintingVisitor(cw.visitMethod(access, name, desc, signature, exceptions), pw, this);
}
public void visitOuterClass(String owner, String name, String desc) {
@@ -123,5 +147,4 @@
public void visitSource(String source, String debug) {
}
-
}
Modified: trunk/dashg/src/com/mebigfatguy/dashg/DashGLineNumberer.java
===================================================================
--- trunk/dashg/src/com/mebigfatguy/dashg/DashGLineNumberer.java 2008-10-28 19:24:51 UTC (rev 30)
+++ trunk/dashg/src/com/mebigfatguy/dashg/DashGLineNumberer.java 2008-10-28 19:25:16 UTC (rev 31)
@@ -19,5 +19,7 @@
package com.mebigfatguy.dashg;
public interface DashGLineNumberer {
+ void inc();
+ void inc(int count);
int getLineNumber();
}
Modified: trunk/dashg/src/com/mebigfatguy/dashg/DashGMethodSourcePrintingVisitor.java
===================================================================
--- trunk/dashg/src/com/mebigfatguy/dashg/DashGMethodSourcePrintingVisitor.java 2008-10-28 19:24:51 UTC (rev 30)
+++ trunk/dashg/src/com/mebigfatguy/dashg/DashGMethodSourcePrintingVisitor.java 2008-10-28 19:25:16 UTC (rev 31)
@@ -19,101 +19,158 @@
package com.mebigfatguy.dashg;
import java.io.PrintWriter;
+import java.text.NumberFormat;
import org.objectweb.asm.AnnotationVisitor;
import org.objectweb.asm.Attribute;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.util.TraceClassVisitor;
public class DashGMethodSourcePrintingVisitor implements MethodVisitor {
- private ClassWriter cw;
+ private MethodVisitor mv;
private PrintWriter pw;
+ private DashGLineNumberer ln;
+ private NumberFormat nf;
- public DashGMethodSourcePrintingVisitor(ClassWriter cWriter, PrintWriter pWriter) {
- cw = cWriter;
+ public DashGMethodSourcePrintingVisitor(MethodVisitor mVisitor, PrintWriter pWriter, DashGLineNumberer lineNumberer) {
+ mv = mVisitor;
pw = pWriter;
+ ln = lineNumberer;
+ nf = NumberFormat.getIntegerInstance();
+ nf.setMinimumIntegerDigits(5);
+ nf.setGroupingUsed(false);
}
- public AnnotationVisitor visitAnnotation(String arg0, boolean arg1) {
- return null;
+ public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
+ return mv.visitAnnotation(desc, visible);
}
public AnnotationVisitor visitAnnotationDefault() {
- return null;
+ return mv.visitAnnotationDefault();
}
- public void visitAttribute(Attribute arg0) {
+ public void visitAttribute(Attribute attr) {
+ mv.visitAttribute(attr);
}
public void visitCode() {
+ mv.visitCode();
}
public void visitEnd() {
+ pw.println("\t}");
+ ln.inc(1);
+ mv.visitEnd();
}
- public void visitFieldInsn(int arg0, String arg1, String arg2, String arg3) {
-
+ public void visitFieldInsn(int opcode, String owner, String name, String desc) {
+ String insn = TraceClassVisitor.OPCODES[opcode];
+ insn += ' ' + name;
+ emitInsn(insn);
+ mv.visitFieldInsn(opcode, owner, name, desc);
}
- public void visitFrame(int arg0, int arg1, Object[] arg2, int arg3,
- Object[] arg4) {
+ public void visitFrame(int type, int nLocal, Object[] local, int nStack, Object[] stack) {
+ mv.visitFrame(type, nLocal, local, nStack, stack);
}
- public void visitIincInsn(int arg0, int arg1) {
+ public void visitIincInsn(int var, int increment) {
+ String insn = "IINC";
+ insn += " a" + var + ", " + increment;
+ emitInsn(insn);
+ mv.visitIincInsn(var, increment);
}
- public void visitInsn(int arg0) {
+ public void visitInsn(int opcode) {
+ String insn = TraceClassVisitor.OPCODES[opcode];
+ emitInsn(insn);
+ mv.visitInsn(opcode);
}
- public void visitIntInsn(int arg0, int arg1) {
+ public void visitIntInsn(int opcode, int operand) {
+ String insn = TraceClassVisitor.OPCODES[opcode];
+ insn += " " + operand;
+ emitInsn(insn);
+ mv.visitIntInsn(opcode, operand);
}
- public void visitJumpInsn(int arg0, Label arg1) {
+ public void visitJumpInsn(int opcode, Label label) {
+ String insn = TraceClassVisitor.OPCODES[opcode];
+ emitInsn(insn);
+ mv.visitJumpInsn(opcode, label);
}
- public void visitLabel(Label arg0) {
+ public void visitLabel(Label label) {
+ mv.visitLabel(label);
}
- public void visitLdcInsn(Object arg0) {
+ public void visitLdcInsn(Object cst) {
+ String insn = "LDC";
+ insn += ' ' + cst.toString();
+ emitInsn(insn);
+ mv.visitLdcInsn(cst);
}
- public void visitLineNumber(int arg0, Label arg1) {
+ public void visitLineNumber(int line, Label start) {
}
- public void visitLocalVariable(String arg0, String arg1, String arg2,
- Label arg3, Label arg4, int arg5) {
+ public void visitLocalVariable(String name, String desc, String signature, Label start, Label end, int index) {
+ mv.visitLocalVariable(name, desc, signature, start, end, index);
}
- public void visitLookupSwitchInsn(Label arg0, int[] arg1, Label[] arg2) {
+ public void visitLookupSwitchInsn(Label dflt, int[] keys, Label[] labels) {
+ mv.visitLookupSwitchInsn(dflt, keys, labels);
}
- public void visitMaxs(int arg0, int arg1) {
+ public void visitMaxs(int maxStack, int maxLocals) {
+ mv.visitMaxs(maxStack, maxLocals);
}
- public void visitMethodInsn(int arg0, String arg1, String arg2, String arg3) {
+ public void visitMethodInsn(int opcode, String owner, String name, String desc) {
+ String insn = TraceClassVisitor.OPCODES[opcode];
+ insn += ' ' + name + desc;
+ emitInsn(insn);
+ mv.visitMethodInsn(opcode, owner, name, desc);
}
- public void visitMultiANewArrayInsn(String arg0, int arg1) {
+ public void visitMultiANewArrayInsn(String desc, int dims) {
+ mv.visitMultiANewArrayInsn(desc, dims);
}
- public AnnotationVisitor visitParameterAnnotation(int arg0, String arg1,
- boolean arg2) {
- return null;
+ public AnnotationVisitor visitParameterAnnotation(int parameter, String desc, boolean visible) {
+ return mv.visitParameterAnnotation(parameter, desc, visible);
}
- public void visitTableSwitchInsn(int arg0, int arg1, Label arg2,
- Label[] arg3) {
+ public void visitTableSwitchInsn(int min, int max, Label dflt, Label[] labels) {
+ mv.visitTableSwitchInsn(min, max, dflt, labels);
}
- public void visitTryCatchBlock(Label arg0, Label arg1, Label arg2,
- String arg3) {
+ public void visitTryCatchBlock(Label start, Label end, Label handler, String type) {
+ mv.visitTryCatchBlock(start, end, handler, type);
}
- public void visitTypeInsn(int arg0, String arg1) {
+ public void visitTypeInsn(int opcode, String type) {
+ String insn = TraceClassVisitor.OPCODES[opcode];
+ insn += ' ' + type;
+ emitInsn(insn);
+ mv.visitTypeInsn(opcode, type);
}
- public void visitVarInsn(int arg0, int arg1) {
+ public void visitVarInsn(int opcode, int var) {
+ String insn = TraceClassVisitor.OPCODES[opcode];
+ insn += " " + var;
+ emitInsn(insn);
+ mv.visitVarInsn(opcode, var);
}
+
+ private void emitInsn(String insn) {
+ Label l = new Label();
+ mv.visitLabel(l);
+ mv.visitLineNumber(ln.getLineNumber(), l);
+ pw.println("\t\tPC = " + nf.format(l.getOffset()) + " // \t\t" + insn);
+ ln.inc();
+ }
}
Deleted: trunk/dashg/src/com/mebigfatguy/dashg/DashGSourceWriter.java
===================================================================
--- trunk/dashg/src/com/mebigfatguy/dashg/DashGSourceWriter.java 2008-10-28 19:24:51 UTC (rev 30)
+++ trunk/dashg/src/com/mebigfatguy/dashg/DashGSourceWriter.java 2008-10-28 19:25:16 UTC (rev 31)
@@ -1,231 +0,0 @@
-/*
- * dashg - A debug symbols (-g) injector
- * Copyright (C) 2008 Dave Brosius
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package com.mebigfatguy.dashg;
-
-import java.io.PrintWriter;
-import java.text.NumberFormat;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-public class DashGSourceWriter extends PrintWriter implements DashGLineNumberer {
-
- enum State {BeforeClass, InClass, InMethod};
-
- private static final Pattern classPattern = Pattern.compile("(.*)class\\s*([^\\s]*)(.*)");
- private static final Pattern methodPattern = Pattern.compile("(.*)\\s+([a-zA-Z0-9<>_]+)\\(([^)]*)\\)([^\\s]+)(\\s+([_a-zA-Z0-9/]*))?");
- private static final Pattern fieldPattern = Pattern.compile("([^L]*)\\s+(L[^;]*;)?\\s+(.+)");
- private static final Pattern cruftPattern = Pattern.compile("((L[0-9]+)|(LINENUMBER)|(LOCALVARIABLE)|(MAXSTACK)|(MAXLOCALS)).*");
-
- private final PrintWriter writer;
- private State state = State.BeforeClass;
- private String clsName = null;
- private int lineNumber = 1;
- private NumberFormat nf;
-
- public DashGSourceWriter(PrintWriter pw, String packageName) {
- super(pw);
- writer = pw;
-
- nf = NumberFormat.getIntegerInstance();
- nf.setMinimumIntegerDigits(5);
- nf.setGroupingUsed(false);
-
- if ((packageName != null) && (packageName.length() > 0)) {
- writer.println("import " + packageName + ";");
- ++lineNumber;
- }
- }
-
- public int getLineNumber() {
- return lineNumber;
- }
-
- @Override
- public void print(String s) {
- String[] lines = s.split("\n");
- for (String l : lines) {
- processLine(l);
- ++lineNumber;
- }
- }
-
- private void processLine(String s) {
- State newState = state;
-
- s = s.trim();
- if (!s.startsWith("//")) {
- switch (state) {
- case BeforeClass:
- if (s.contains(" class ")) {
- Matcher m = classPattern.matcher(s);
- if (m.matches()) {
- String atts = m.group(1);
- clsName = m.group(2);
- String ext = m.group(3);
-
- int slashPos = clsName.lastIndexOf('/');
- if (slashPos >= 0)
- clsName = clsName.substring(slashPos+1);
-
- s = atts + "class " + clsName + ext.replace('/', '.');
- newState = State.InClass;
- }
- }
- break;
-
- case InClass:
- Matcher m = methodPattern.matcher(s);
- if (m.matches()) {
- m = methodPattern.matcher(s);
- if (m.matches()) {
- String atts = m.group(1);
- String name = m.group(2);
- String parms = m.group(3);
- String ret = m.group(4);
- String thr = m.group(6);
-
- if ("<init>".equals(name)) {
- name = clsName;
- }
-
- StringBuilder realParms = new StringBuilder();
- String comma = "";
- int parmNum = atts.contains("static") ? 0 : 1;
- while (parms.length() > 0) {
- realParms.append(comma);
- comma = ", ";
- String type = convertType(parms);
- realParms.append(type);
- realParms.append(' ');
- realParms.append(parmName(type, parmNum));
- parmNum += typeSize(type);
- parms = skipType(parms);
- }
- parms = realParms.toString();
-
- if (thr == null)
- thr = "";
- else
- thr = thr.replace('/', '.');
- s = atts + ' ' + convertType(ret) + ' ' + name + '(' + parms + ')' + thr;
- }
- newState = State.InMethod;
- } else {
- m = fieldPattern.matcher(s);
- if (m.matches()) {
- String type = m.group(2);
- if (type != null) {
- type = convertType(type);
- s = m.group(1) + ' ' + type + ' ' + m.group(3);
- }
-
- s += ";";
- }
- }
- break;
-
- case InMethod:
- if (s.length() == 0) {
- newState = State.InClass;
- }
- if (s.startsWith("//"))
- return;
-
- m = cruftPattern.matcher(s);
- if (m.matches()) {
- return;
- }
-
- s = "\tPC = " + nf.format(0) + ";\t// " + s;
- break;
- }
- }
-
- if ((newState == State.InClass) && (state == State.InMethod)) {
- super.print("}\n");
- ++lineNumber;
- }
-
- super.print(s + "\n");
-
- if ((state == State.InClass) && (newState == State.InMethod)) {
- super.print("{\n");
- ++lineNumber;
- super.print("\tint PC;\n");
- ++lineNumber;
- super.print("\n");
- ++lineNumber;
- }
-
- state = newState;
- }
-
- private String convertType(String type) {
- char c = type.charAt(0);
- switch (c) {
- case 'L':
- return type.substring(1, type.indexOf(';')).replace('/', '.');
- case '[':
- return convertType(type.substring(1)) + "[]";
- case 'C':
- return "char";
- case 'B':
- return "byte";
- case 'S':
- return "short";
- case 'I':
- return "int";
- case 'J':
- return "long";
- case 'F':
- return "float";
- case 'D':
- return "double";
- case 'Z':
- return "boolean";
- case 'V':
- return "void";
- }
- throw new RuntimeException("Type not processed: " + type);
- }
-
- private int typeSize(String typeName) {
- return ("long".equals(typeName) || "double".equals(typeName)) ? 2 : 1;
- }
-
- private String parmName(String type, int parmNum) {
- int dotPos = type.lastIndexOf('.');
- if (dotPos >= 0)
- type = type.substring(dotPos+1);
- return type.toLowerCase() + parmNum;
- }
-
- private String skipType(String type) {
- if (type.length() == 0)
- return type;
-
- if (type.charAt(0) == '[')
- return skipType(type.substring(1));
-
- if (type.charAt(0) == 'L')
- return type.substring(type.indexOf(';') + 1);
-
- return type.substring(1);
- }
-}
Modified: trunk/dashg/src/com/mebigfatguy/dashg/DashGTask.java
===================================================================
--- trunk/dashg/src/com/mebigfatguy/dashg/DashGTask.java 2008-10-28 19:24:51 UTC (rev 30)
+++ trunk/dashg/src/com/mebigfatguy/dashg/DashGTask.java 2008-10-28 19:25:16 UTC (rev 31)
@@ -115,8 +115,8 @@
ClassReader cr = new ClassReader(bis);
ClassWriter cw = new ClassWriter(cr, ClassWriter.COMPUTE_MAXS);
- DashGSourceWriter sw = new DashGSourceWriter(pw, packageName);
- ClassAdapter ca = new DashGClassAdapter(new TraceClassVisitor(cw, sw), sw, baseName);
+ DashGClassSourcePrintingVisitor spv = new DashGClassSourcePrintingVisitor(cw, pw);
+ ClassAdapter ca = new DashGClassAdapter(spv, spv, baseName);
cr.accept(ca, 0);
byte[] classData = cw.toByteArray();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-10-28 19:27:10
|
Revision: 32
http://dashg.svn.sourceforge.net/dashg/?rev=32&view=rev
Author: dbrosius
Date: 2008-10-28 19:27:07 +0000 (Tue, 28 Oct 2008)
Log Message:
-----------
oi
Modified Paths:
--------------
trunk/dashg/src/com/mebigfatguy/dashg/DashGMethodSourcePrintingVisitor.java
trunk/dashg/src/com/mebigfatguy/dashg/DashGTask.java
Modified: trunk/dashg/src/com/mebigfatguy/dashg/DashGMethodSourcePrintingVisitor.java
===================================================================
--- trunk/dashg/src/com/mebigfatguy/dashg/DashGMethodSourcePrintingVisitor.java 2008-10-28 19:25:16 UTC (rev 31)
+++ trunk/dashg/src/com/mebigfatguy/dashg/DashGMethodSourcePrintingVisitor.java 2008-10-28 19:27:07 UTC (rev 32)
@@ -23,7 +23,6 @@
import org.objectweb.asm.AnnotationVisitor;
import org.objectweb.asm.Attribute;
-import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.util.TraceClassVisitor;
Modified: trunk/dashg/src/com/mebigfatguy/dashg/DashGTask.java
===================================================================
--- trunk/dashg/src/com/mebigfatguy/dashg/DashGTask.java 2008-10-28 19:25:16 UTC (rev 31)
+++ trunk/dashg/src/com/mebigfatguy/dashg/DashGTask.java 2008-10-28 19:27:07 UTC (rev 32)
@@ -37,7 +37,6 @@
import org.objectweb.asm.ClassAdapter;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassWriter;
-import org.objectweb.asm.util.TraceClassVisitor;
public class DashGTask extends Task {
@@ -78,16 +77,13 @@
private void generateDashGFiles(File baseDirectory, String fName) {
String packagePath;
- String packageName;
try {
int sepPos = fName.lastIndexOf(File.separator);
if (sepPos >= 0) {
packagePath = fName.substring(0, sepPos);
- packageName = packagePath.replaceAll("\\" + File.separator, ".");
} else {
packagePath = null;
- packageName = null;
}
String fileBaseName = fName.substring(sepPos+1, fName.length() - ".class".length());
@@ -98,13 +94,13 @@
File dstSrcFile = new File(destDir, fileBaseName + ".java");
File dstClsFile = new File(destDir, fileBaseName + ".class");
- buildNewClass(new File(baseDirectory, fName), dstSrcFile, dstClsFile, packageName, fileBaseName);
+ buildNewClass(new File(baseDirectory, fName), dstSrcFile, dstClsFile, fileBaseName);
} catch (Exception ioe) {
throw new BuildException("Failed generating output files for file " + fName, ioe);
}
}
- public void buildNewClass(File inputClass, File outputSrc, File outputClass, String packageName, String baseName) throws IOException {
+ public void buildNewClass(File inputClass, File outputSrc, File outputClass, String baseName) throws IOException {
BufferedInputStream bis = null;
BufferedOutputStream bos = null;
PrintWriter pw = null;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-10-28 21:59:11
|
Revision: 36
http://dashg.svn.sourceforge.net/dashg/?rev=36&view=rev
Author: dbrosius
Date: 2008-10-28 21:59:05 +0000 (Tue, 28 Oct 2008)
Log Message:
-----------
fix parm names
Modified Paths:
--------------
trunk/dashg/src/com/mebigfatguy/dashg/DashGClassSourcePrintingVisitor.java
trunk/dashg/src/com/mebigfatguy/dashg/DashGUtils.java
Modified: trunk/dashg/src/com/mebigfatguy/dashg/DashGClassSourcePrintingVisitor.java
===================================================================
--- trunk/dashg/src/com/mebigfatguy/dashg/DashGClassSourcePrintingVisitor.java 2008-10-28 21:50:10 UTC (rev 35)
+++ trunk/dashg/src/com/mebigfatguy/dashg/DashGClassSourcePrintingVisitor.java 2008-10-28 21:59:05 UTC (rev 36)
@@ -27,6 +27,7 @@
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.FieldVisitor;
import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
public class DashGClassSourcePrintingVisitor implements ClassVisitor, DashGLineNumberer {
@@ -125,12 +126,14 @@
pw.print(name);
List<String> args = DashGUtils.getArguments(desc);
String comma = "(";
+ int parmNum = ((access & Opcodes.ACC_STATIC) != 0) ? 0 : 1;
for (String a : args) {
pw.print(comma);
comma = ", ";
pw.print(a);
pw.print(' ');
- pw.print('x');
+ pw.print(DashGUtils.parmName(a, parmNum));
+ parmNum += DashGUtils.typeSize(a);
}
pw.print(") ");
Modified: trunk/dashg/src/com/mebigfatguy/dashg/DashGUtils.java
===================================================================
--- trunk/dashg/src/com/mebigfatguy/dashg/DashGUtils.java 2008-10-28 21:50:10 UTC (rev 35)
+++ trunk/dashg/src/com/mebigfatguy/dashg/DashGUtils.java 2008-10-28 21:59:05 UTC (rev 36)
@@ -111,4 +111,18 @@
return type.substring(1);
}
+
+ public static String parmName(String type, int parmNum) {
+ int dotPos = type.lastIndexOf('.');
+ if (dotPos >= 0)
+ type = type.substring(dotPos+1);
+ int lBracketPos = type.indexOf('[');
+ if (lBracketPos >= 0)
+ type = type.substring(0, lBracketPos) + 's';
+ return type.toLowerCase() + parmNum;
+ }
+
+ public static int typeSize(String typeName) {
+ return ("long".equals(typeName) || "double".equals(typeName)) ? 2 : 1;
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-10-28 22:03:18
|
Revision: 37
http://dashg.svn.sourceforge.net/dashg/?rev=37&view=rev
Author: dbrosius
Date: 2008-10-28 22:03:16 +0000 (Tue, 28 Oct 2008)
Log Message:
-----------
PC -> pc
Modified Paths:
--------------
trunk/dashg/src/com/mebigfatguy/dashg/DashGClassSourcePrintingVisitor.java
trunk/dashg/src/com/mebigfatguy/dashg/DashGMethodSourcePrintingVisitor.java
Modified: trunk/dashg/src/com/mebigfatguy/dashg/DashGClassSourcePrintingVisitor.java
===================================================================
--- trunk/dashg/src/com/mebigfatguy/dashg/DashGClassSourcePrintingVisitor.java 2008-10-28 21:59:05 UTC (rev 36)
+++ trunk/dashg/src/com/mebigfatguy/dashg/DashGClassSourcePrintingVisitor.java 2008-10-28 22:03:16 UTC (rev 37)
@@ -138,7 +138,7 @@
pw.print(") ");
pw.println("{");
- pw.println("\t\tint PC;");
+ pw.println("\t\tint pc;");
pw.println();
lineNumber += 4;
Modified: trunk/dashg/src/com/mebigfatguy/dashg/DashGMethodSourcePrintingVisitor.java
===================================================================
--- trunk/dashg/src/com/mebigfatguy/dashg/DashGMethodSourcePrintingVisitor.java 2008-10-28 21:59:05 UTC (rev 36)
+++ trunk/dashg/src/com/mebigfatguy/dashg/DashGMethodSourcePrintingVisitor.java 2008-10-28 22:03:16 UTC (rev 37)
@@ -208,7 +208,7 @@
Label l = new Label();
mv.visitLabel(l);
mv.visitLineNumber(ln.getLineNumber(), l);
- pw.println("\t\tPC = " + nf.format(l.getOffset()) + " // \t\t" + insn);
+ pw.println("\t\tpc = " + nf.format(l.getOffset()) + " // \t\t" + insn);
ln.inc();
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-10-28 22:19:10
|
Revision: 39
http://dashg.svn.sourceforge.net/dashg/?rev=39&view=rev
Author: dbrosius
Date: 2008-10-28 22:19:03 +0000 (Tue, 28 Oct 2008)
Log Message:
-----------
cleanup src output
Modified Paths:
--------------
trunk/dashg/src/com/mebigfatguy/dashg/DashGClassSourcePrintingVisitor.java
trunk/dashg/src/com/mebigfatguy/dashg/DashGMethodSourcePrintingVisitor.java
Modified: trunk/dashg/src/com/mebigfatguy/dashg/DashGClassSourcePrintingVisitor.java
===================================================================
--- trunk/dashg/src/com/mebigfatguy/dashg/DashGClassSourcePrintingVisitor.java 2008-10-28 22:05:17 UTC (rev 38)
+++ trunk/dashg/src/com/mebigfatguy/dashg/DashGClassSourcePrintingVisitor.java 2008-10-28 22:19:03 UTC (rev 39)
@@ -71,7 +71,7 @@
pw.print(DashGUtils.getAttribute(access));
- pw.print(clsName + ' ');
+ pw.print("class " + clsName + ' ');
if (!superName.equals("java/lang/Object"))
pw.print("extends " + superName.replace('/', '.') + ' ');
@@ -126,7 +126,8 @@
name = clsName;
pw.print(name);
List<String> args = DashGUtils.getArguments(desc);
- String comma = "(";
+ pw.print('(');
+ String comma = "";
int parmNum = ((access & Opcodes.ACC_STATIC) != 0) ? 0 : 1;
for (String a : args) {
pw.print(comma);
Modified: trunk/dashg/src/com/mebigfatguy/dashg/DashGMethodSourcePrintingVisitor.java
===================================================================
--- trunk/dashg/src/com/mebigfatguy/dashg/DashGMethodSourcePrintingVisitor.java 2008-10-28 22:05:17 UTC (rev 38)
+++ trunk/dashg/src/com/mebigfatguy/dashg/DashGMethodSourcePrintingVisitor.java 2008-10-28 22:19:03 UTC (rev 39)
@@ -19,6 +19,7 @@
package com.mebigfatguy.dashg;
import java.io.PrintWriter;
+import java.text.MessageFormat;
import java.text.NumberFormat;
import java.util.HashMap;
import java.util.Map;
@@ -31,19 +32,17 @@
public class DashGMethodSourcePrintingVisitor implements MethodVisitor {
+ private static final String BLANKS = " ";
+
private MethodVisitor mv;
private PrintWriter pw;
private DashGLineNumberer ln;
- private NumberFormat nf;
private Map<String, Integer> labelsToOffset;
public DashGMethodSourcePrintingVisitor(MethodVisitor mVisitor, PrintWriter pWriter, DashGLineNumberer lineNumberer) {
mv = mVisitor;
pw = pWriter;
ln = lineNumberer;
- nf = NumberFormat.getIntegerInstance();
- nf.setMinimumIntegerDigits(5);
- nf.setGroupingUsed(false);
labelsToOffset = new HashMap<String, Integer>();
}
@@ -208,7 +207,12 @@
Label l = new Label();
mv.visitLabel(l);
mv.visitLineNumber(ln.getLineNumber(), l);
- pw.println("\t\tpc = " + nf.format(l.getOffset()) + " // \t\t" + insn);
+ pw.println("\t\tpc = " + formatOffset(l.getOffset()) + "; // \t\t" + insn);
ln.inc();
}
+
+ private String formatOffset(int offset) {
+ String offsetString = String.valueOf(offset);
+ return BLANKS.substring(0, BLANKS.length() - offsetString.length()) + offsetString;
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2010-06-09 06:02:07
|
Revision: 50
http://dashg.svn.sourceforge.net/dashg/?rev=50&view=rev
Author: dbrosius
Date: 2010-06-09 06:02:01 +0000 (Wed, 09 Jun 2010)
Log Message:
-----------
warnings
Modified Paths:
--------------
trunk/dashg/src/com/mebigfatguy/dashg/DashGMethodSourcePrintingVisitor.java
trunk/dashg/src/com/mebigfatguy/dashg/DashGTask.java
Modified: trunk/dashg/src/com/mebigfatguy/dashg/DashGMethodSourcePrintingVisitor.java
===================================================================
--- trunk/dashg/src/com/mebigfatguy/dashg/DashGMethodSourcePrintingVisitor.java 2010-01-02 05:11:06 UTC (rev 49)
+++ trunk/dashg/src/com/mebigfatguy/dashg/DashGMethodSourcePrintingVisitor.java 2010-06-09 06:02:01 UTC (rev 50)
@@ -26,16 +26,16 @@
import org.objectweb.asm.Attribute;
import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
-import org.objectweb.asm.util.TraceClassVisitor;
+import org.objectweb.asm.util.AbstractVisitor;
public class DashGMethodSourcePrintingVisitor implements MethodVisitor {
private static final String BLANKS = " ";
- private MethodVisitor mv;
- private PrintWriter pw;
- private DashGLineNumberer ln;
- private Map<String, Integer> labelsToOffset;
+ private final MethodVisitor mv;
+ private final PrintWriter pw;
+ private final DashGLineNumberer ln;
+ private final Map<String, Integer> labelsToOffset;
public DashGMethodSourcePrintingVisitor(MethodVisitor mVisitor, PrintWriter pWriter, DashGLineNumberer lineNumberer) {
mv = mVisitor;
@@ -71,7 +71,7 @@
}
public void visitFieldInsn(int opcode, String owner, String name, String desc) {
- String insn = TraceClassVisitor.OPCODES[opcode];
+ String insn = AbstractVisitor.OPCODES[opcode];
insn += ' ' + name;
emitInsn(insn);
mv.visitFieldInsn(opcode, owner, name, desc);
@@ -89,20 +89,20 @@
}
public void visitInsn(int opcode) {
- String insn = TraceClassVisitor.OPCODES[opcode];
+ String insn = AbstractVisitor.OPCODES[opcode];
emitInsn(insn);
mv.visitInsn(opcode);
}
public void visitIntInsn(int opcode, int operand) {
- String insn = TraceClassVisitor.OPCODES[opcode];
+ String insn = AbstractVisitor.OPCODES[opcode];
insn += " " + operand;
emitInsn(insn);
mv.visitIntInsn(opcode, operand);
}
public void visitJumpInsn(int opcode, Label label) {
- String insn = TraceClassVisitor.OPCODES[opcode];
+ String insn = AbstractVisitor.OPCODES[opcode];
insn += " " + label.toString();
emitInsn(insn);
mv.visitJumpInsn(opcode, label);
@@ -148,7 +148,7 @@
}
public void visitMethodInsn(int opcode, String owner, String name, String desc) {
- String insn = TraceClassVisitor.OPCODES[opcode];
+ String insn = AbstractVisitor.OPCODES[opcode];
insn += ' ' + name + desc;
emitInsn(insn);
mv.visitMethodInsn(opcode, owner, name, desc);
@@ -188,14 +188,14 @@
}
public void visitTypeInsn(int opcode, String type) {
- String insn = TraceClassVisitor.OPCODES[opcode];
+ String insn = AbstractVisitor.OPCODES[opcode];
insn += ' ' + type;
emitInsn(insn);
mv.visitTypeInsn(opcode, type);
}
public void visitVarInsn(int opcode, int var) {
- String insn = TraceClassVisitor.OPCODES[opcode];
+ String insn = AbstractVisitor.OPCODES[opcode];
insn += " " + var;
emitInsn(insn);
mv.visitVarInsn(opcode, var);
Modified: trunk/dashg/src/com/mebigfatguy/dashg/DashGTask.java
===================================================================
--- trunk/dashg/src/com/mebigfatguy/dashg/DashGTask.java 2010-01-02 05:11:06 UTC (rev 49)
+++ trunk/dashg/src/com/mebigfatguy/dashg/DashGTask.java 2010-06-09 06:02:01 UTC (rev 50)
@@ -42,7 +42,7 @@
public class DashGTask extends Task {
static final int BUFFER_SIZE = 5120;
- enum State {LookForMethod, ProcessLine};
+ enum State {LookForMethod, ProcessLine}
FileSet classSource;
File directory;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|