Commit 43562d7a authored by andrei's avatar andrei

Changed dependency of bco to 3.0.0.beta of asm. Small build changes for asm...

Changed dependency of bco to 3.0.0.beta of asm. Small build changes for asm and bco (as recommended by Eclipse docu). asm should use manifest.mf, bco shouldn't be deployed as a jar inside of jar.

[[Split portion of a mixed commit.]]
parent 8cdc40d0
This diff is collapsed.
#Fri Jan 07 19:52:43 CET 2005
comment_format_source_code=true
org.eclipse.jdt.ui.exception.name=e
comment_new_line_for_parameter=false
#Sun Apr 09 15:48:06 CEST 2006
comment_clear_blank_lines=true
comment_format_comments=true
comment_format_header=true
comment_format_html=true
comment_format_source_code=true
comment_indent_parameter_description=false
comment_indent_root_tags=false
comment_line_length=90
org.eclipse.jdt.ui.gettersetter.use.is=true
comment_format_header=true
comment_new_line_for_parameter=false
comment_separate_root_tags=false
eclipse.preferences.version=1
comment_format_comments=true
comment_indent_parameter_description=false
formatter_settings_version=10
internal.default.compliance=user
org.eclipse.jdt.ui.exception.name=e
org.eclipse.jdt.ui.gettersetter.use.is=true
org.eclipse.jdt.ui.keywordthis=false
comment_separate_root_tags=false
comment_clear_blank_lines=true
comment_indent_root_tags=false
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Bytecode Outline Plug-in
Bundle-SymbolicName: de.loskutov.BytecodeOutline;singleton=true
Bundle-Version: 2.0.4
Bundle-ClassPath: BytecodeOutline.jar
Bundle-SymbolicName: de.loskutov.BytecodeOutline;singleton:=true
Bundle-Version: 2.1.0
Bundle-Activator: de.loskutov.bco.BytecodeOutlinePlugin
Bundle-Vendor: Andrei Loskutov
Bundle-Localization: plugin
......@@ -20,5 +20,5 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.ui.console,
org.eclipse.help.base,
org.eclipse.help.appserver,
org.objectweb.asm;bundle-version="2.0.0"
org.objectweb.asm;bundle-version="3.0.0"
Eclipse-AutoStart: true
plugin.id=de.loskutov.BytecodeOutline
plugin.version=2.0.4
plugin.version=2.1.0
bin.includes = LICENSE.txt,\
README.txt,\
META-INF/,\
externals/,\
icons/,\
plugin.xml,\
BytecodeOutline.jar
.,\
about.html
jars.compile.order = BytecodeOutline.jar
jars.compile.order = .
source.. = src/
output.. = bin/
......@@ -10,39 +10,40 @@
<property name="plugin.jar" value="${plugin.id}_${plugin.version}.jar"/>
<property name="feature.jar" value="${plugin.id}.feature_${plugin.version}.jar"/>
<target name="init">
<path id="classpath">
<fileset dir="${eclipse.home}" includes="plugins/**/*.jar"/>
<fileset dir="${asm.project.dir}" includes="**/*.jar"/>
<fileset dir="${asm.project.dir}" includes="**/lib/*.jar"/>
<fileset dir="${eclipse.home}" includes="plugins/**/*.jar"/>
</path>
</target>
<target name="compile" depends="init">
<mkdir dir="${out.build}"/>
<!-- Eclipse requires JDK 1.4, also we can set both properties to 1.4 -->
<javac destdir="${out.build}" debug="on" source="1.4" target="1.4">
<javac destdir="${out.build}" debug="on" source="1.4" target="1.4" >
<classpath refid="classpath"/>
<src path="${src}"/>
<include name="**/*.java"/>
</javac>
</javac>
</target>
<target name="jars" depends="compile">
<copy todir="${out.build}">
<fileset dir="${src}">
<fileset dir="${src}">
<include name="**/*.properties"/>
</fileset>
</copy>
<jar jarfile="${out}/BytecodeOutline.jar" basedir="${out.build}">
</copy>
<!--
<jar jarfile="${out}/BytecodeOutline.jar" basedir="${out.build}">
<include name="**/*"/>
<manifest>
<attribute name="Implementation-Title" value="BytecodeOutline"/>
<attribute name="Implementation-Version" value="${plugin.version}"/>
</manifest>
</jar>
</jar> -->
<zip zipfile="${out}/BytecodeOutlinesrc.zip">
<zipfileset dir="${src}" includes="**/*" prefix="src"/>
<fileset dir=".">
......@@ -60,13 +61,13 @@
<fileset dir="site">
<include name="feature.xml"/>
<include name="site.xml"/>
</fileset>
</fileset>
</zip>
</target>
<target name="plugin" depends="jars,xslt">
<zip zipfile="${out}/${plugin.jar}">
<zipfileset dir="${out}" includes="BytecodeOutline.jar,BytecodeOutlinesrc.zip"/>
<zipfileset dir="${out}" includes="BytecodeOutlinesrc.zip"/>
<fileset dir=".">
<include name="META-INF/MANIFEST.MF"/>
<include name="icons/**/*"/>
......@@ -74,16 +75,19 @@
<include name="about.html"/>
<include name="*.txt"/>
</fileset>
<fileset dir="${out.build}">
<include name="**/*"/>
</fileset>
<zipfileset dir="${out}/doc" includes="toc.xml,ref-*.html" prefix="doc"/>
</zip>
</target>
<target name="feature" depends="plugin">
<jar zipfile="${out}/${feature.jar}">
<fileset dir="site" includes="feature.xml"/>
</jar>
</target>
<target name="site" depends="feature">
<zip zipfile="${out}/${plugin.id}.update_${plugin.version}.zip">
<zipfileset dir="site" includes="site.xml"/>
......@@ -91,19 +95,19 @@
<zipfileset dir="${out}" includes="${plugin.jar}" prefix="plugins"/>
</zip>
</target>
<target name="clean">
<delete failonerror="false" includeEmptyDirs="true">
<fileset dir="${out}" includes="**/*"/>
</delete>
</target>
<target name="xslt">
<mkdir dir="${out}/doc"/>
<xslt basedir="." destdir="${out}/doc" includes="opcodes.xml"
style="opcodes-doc.xsl" force="true">
<factory name="net.sf.saxon.TransformerFactoryImpl"/>
</xslt>
</target>
<target name="xslt" depends="init">
<mkdir dir="${out}/doc"/>
<xslt basedir="." destdir="${out}/doc" includes="opcodes.xml"
style="opcodes-doc.xsl" force="true">
<factory name="net.sf.saxon.TransformerFactoryImpl" />
</xslt>
</target>
</project>
......@@ -2,7 +2,7 @@
<feature
id="de.loskutov.BytecodeOutline.feature"
label="Bytecode Outline"
version="2.0.2"
version="2.1.0"
provider-name="Andrei Loskutov">
<description url="http://asm.objectweb.org/eclipse/bco/index.html">
......@@ -33,27 +33,33 @@ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS&apos;&apos; AND
<discovery label="ObjectWeb update site" url="http://download.forge.objectweb.org/eclipse-update/site.xml"/>
</url>
<includes id="org.objectweb.asm.feature" version="2.0.0" optional="false"/>
<includes
id="org.objectweb.asm.feature"
version="3.0.0"/>
<requires>
<import plugin="org.eclipse.ui"/>
<import plugin="org.eclipse.ui.editors"/>
<import plugin="org.eclipse.core.runtime"/>
<import plugin="org.eclipse.jface.text"/>
<import plugin="org.eclipse.core.filebuffers"/>
<import plugin="org.eclipse.jdt.core"/>
<import plugin="org.eclipse.ui.editors"/>
<import plugin="org.eclipse.ui.workbench.texteditor"/>
<import plugin="org.eclipse.jdt.ui"/>
<import plugin="org.eclipse.core.resources"/>
<import plugin="org.eclipse.ui.ide"/>
<import plugin="org.eclipse.jdt"/>
<import plugin="org.eclipse.compare"/>
<import plugin="org.eclipse.ui.console"/>
<import plugin="org.eclipse.help.base"/>
<import plugin="org.eclipse.help.appserver"/>
<import plugin="org.objectweb.asm" version="3.0.0" match="greaterOrEqual"/>
</requires>
<plugin
id="de.loskutov.BytecodeOutline"
download-size="0"
install-size="0"
version="2.0.2"/>
download-size="351"
install-size="351"
version="2.1.0"
unpack="false"/>
</feature>
......@@ -3,9 +3,9 @@
<description url="http://asm.objectweb.org/eclipse/bco/index.html">
Bytecode Outline Plugin Update Site
</description>
<feature url="features/de.loskutov.BytecodeOutline.feature_2.0.2.jar" id="de.loskutov.BytecodeOutline.feature" version="2.0.2">
<feature url="features/de.loskutov.BytecodeOutline.feature_2.1.0.jar" id="de.loskutov.BytecodeOutline.feature" version="2.1.0">
<category name="bytecode-outline"/>
</feature>
<archive path="plugins/de.loskutov.BytecodeOutline_2.0.2.jar" url="http://download.forge.objectweb.org/asm/de.loskutov.BytecodeOutline_2.0.2.jar"/>
<archive path="plugins/de.loskutov.BytecodeOutline_2.1.0.jar" url="http://download.forge.objectweb.org/asm/de.loskutov.BytecodeOutline_2.1.0.jar"/>
<category-def name="bytecode-outline" label="Bytecode Outline"/>
</site>
......@@ -223,7 +223,7 @@ public class DecompiledMethod {
public String[][] getTextTable() {
Frame frame = null;
String error = "";
String error1 = "";
List lines = new ArrayList();
for (int i = 0; i < text.size(); ++i) {
Object o = text.get(i);
......@@ -231,7 +231,7 @@ public class DecompiledMethod {
if (frames != null) {
frame = frames[((Index) o).insn];
if (this.error != null && ((Index) o).insn == this.errorInsn) {
error = this.error;
error1 = this.error;
}
}
} else {
......@@ -250,9 +250,9 @@ public class DecompiledMethod {
stack = " ";
}
}
lines.add(new String[]{locals, stack, o.toString(), error});
lines.add(new String[]{locals, stack, o.toString(), error1});
frame = null;
error = "";
error1 = "";
}
}
return (String[][]) lines.toArray(new String[lines.size()][]);
......
......@@ -74,9 +74,9 @@ public class DecompilerClassVisitor extends ClassAdapter {
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
MethodVisitor mv = super.visitMethod(access, name, desc, signature, exceptions);
return mv==null ? null : new MethodAdapter(mv) {
public void visitLocalVariable(String name, String desc, String signature, Label start, Label end, int index) {
public void visitLocalVariable(String name1, String desc1, String signature1, Label start, Label end, int index) {
if(modes.get(BCOConstants.F_SHOW_VARIABLES)) {
super.visitLocalVariable(name, desc, signature, start, end, index);
super.visitLocalVariable(name1, desc1, signature1, start, end, index);
}
}
public void visitLineNumber(int line, Label start) {
......@@ -86,11 +86,11 @@ public class DecompilerClassVisitor extends ClassAdapter {
}
};
}
}, false);
}, 0);
return dcv.getResult(cl);
}
public static DecompiledClass getDecompiledClass(final InputStream is,
final String field, final String method, final boolean raw,
final boolean asmify, final boolean verify, final ClassLoader cl)
......@@ -112,7 +112,7 @@ public class DecompilerClassVisitor extends ClassAdapter {
}
DecompilerClassVisitor dcv = new DecompilerClassVisitor(
cv, field, method, verify);
cr.accept(dcv, false);
cr.accept(dcv, 0);
return dcv.getResult(cl);
}
......
......@@ -191,6 +191,15 @@ public class DecompilerMethodVisitor extends MethodAdapter {
}
}
public void visitFrame(int type, int nLocal, Object[] local, int nStack,
Object[] stack) {
addIndex(-1);
super.visitFrame(type, nLocal, local, nStack, stack);
if (meth != null) {
meth.visitFrame(type, nLocal, local, nStack, stack);
}
}
protected void addIndex(final int opcode) {
text.add(new Index(currentLabel, currentInsn++, opcode));
}
......
/* $Id: BytecodeClassFileEditor.java,v 1.2 2005-02-07 18:59:14 andrei Exp $ */
/* $Id: BytecodeClassFileEditor.java,v 1.3 2006-04-09 15:06:59 andrei Exp $ */
package de.loskutov.bco.editors;
......@@ -178,14 +178,15 @@ public class BytecodeClassFileEditor extends ClassFileEditor {
range = containsDecompiled()
? sourceMapper.getNameRange(member)
: member.getNameRange();
offset = range.getOffset();
length = range.getLength();
if (range != null && offset > -1 && length > 0) {
if (getSourceViewer() != null) {
getSourceViewer().revealRange(offset, length);
getSourceViewer().setSelectedRange(offset, length);
if(range != null){
offset = range.getOffset();
length = range.getLength();
if (offset > -1 && length > 0) {
if (getSourceViewer() != null) {
getSourceViewer().revealRange(offset, length);
getSourceViewer().setSelectedRange(offset, length);
}
}
}
}
......
......@@ -1264,7 +1264,7 @@ public class BytecodeOutlineView extends ViewPart {
} catch (IOException e) {
try {
// check if compilation unit is ok - then this is the user problem
if (type != null && type.isStructureKnown()) {
if (type.isStructureKnown()) {
BytecodeOutlinePlugin.error(null, e);
}
} catch (JavaModelException e1) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment