better debugging messages

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@620 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent 4ba3551e10
commit 7aac88b69d
  1. 19
      jode/jode/bytecode/ConstantPool.java

@ -246,22 +246,31 @@ public class ConstantPool {
public String toString(int i) { public String toString(int i) {
switch (tags[i]) { switch (tags[i]) {
case CLASS: case CLASS:
return "class "+toString(indices1[i]); return "Class "+toString(indices1[i]);
case STRING: case STRING:
return "\""+toString(indices1[i])+"\""; return "String \""+toString(indices1[i])+"\"";
case INTEGER: case INTEGER:
return "Int "+constants[i].toString();
case FLOAT: case FLOAT:
return "Float "+constants[i].toString();
case LONG: case LONG:
return "Long "+constants[i].toString();
case DOUBLE: case DOUBLE:
return "Double "+constants[i].toString();
case UTF8: case UTF8:
return constants[i].toString(); return constants[i].toString();
case FIELDREF: case FIELDREF:
return "Fieldref: "+toString(indices1[i])+"; "
+ toString(indices2[i]);
case METHODREF: case METHODREF:
return "Methodref: "+toString(indices1[i])+"; "
+ toString(indices2[i]);
case INTERFACEMETHODREF: case INTERFACEMETHODREF:
return "Ref: "+toString(indices1[i])+": " return "Interfaceref: "+toString(indices1[i])+"; "
+ toString(indices2[i]); + toString(indices2[i]);
case NAMEANDTYPE: case NAMEANDTYPE:
return toString(indices1[i])+" "+toString(indices2[i]); return "Name "+toString(indices1[i])
+"; Type "+toString(indices2[i]);
default: default:
return "unknown tag: "+tags[i]; return "unknown tag: "+tags[i];
} }
@ -274,7 +283,7 @@ public class ConstantPool {
public String toString() { public String toString() {
StringBuffer result = new StringBuffer("[ null"); StringBuffer result = new StringBuffer("[ null");
for (int i=1; i< count; i++) { for (int i=1; i< count; i++) {
result.append(", ").append(toString(i)); result.append(", ").append(i).append(" = ").append(toString(i));
} }
result.append(" ]"); result.append(" ]");
return result.toString(); return result.toString();

Loading…
Cancel
Save