| java.lang.Object xtc.lang.ClassfileSourceRemapper
ClassfileSourceRemapper | public class ClassfileSourceRemapper (Code) | | A class file post-processor to rewrite a class file for the remapped line
number table or to append a SMAP attribute to the class file. This
post-processor is a utility for the source-to-source transformation tools
such as Jeannie. This post-processor provides the following two modes.
First, stratify mode with -stratify command line flag rewrites the
"LineNumberTable" attribute for each method in the class file, and modify the
"SourceFile" attribute. This has an advantage of working well with both the
current java VM and debugger. However, this does not work if the number of
the orignal source files is more than one.
Second, flatten mode with -flatten command line flag appends an SMAP to the
end of the class file as "SourceDebugExtension." This is a general and
powerful way to provide remapping information for the source-to-source
transformation. We found that this SMAP works well with the current java
debuggers (SUN jdb 1.6 and eclipse 3.2 Java debugger). However, JVMs in the
SUN JDK 1.6 and IBM J9 1.5.0 do not use SMAP when they dump stack trace.
By default, this remapper operates in the flatten mode. The first solution
with the SMAP will be the right way in the long run as JVM supports better
stack dump messgage with SMAP.
author: Byeongcheol Lee |
Method Summary | |
public void | doRemapping() Update the line number mapping in the class file. | public static void | main(String[] args) Run the class file remapping process by taking a user command line. |
CP_Class | final public static int CP_Class(Code) | | Constant pool tags for java class file. For further information, look at
the Java virtual machine specification.
http://java.sun.com/docs/books/jvms/second_edition/html/ClassFile.doc.html
|
CP_Double | final public static int CP_Double(Code) | | |
CP_Fieldref | final public static int CP_Fieldref(Code) | | |
CP_Float | final public static int CP_Float(Code) | | |
CP_Integer | final public static int CP_Integer(Code) | | |
CP_InterfaceMethodref | final public static int CP_InterfaceMethodref(Code) | | |
CP_Long | final public static int CP_Long(Code) | | |
CP_Methodref | final public static int CP_Methodref(Code) | | |
CP_NameAndType | final public static int CP_NameAndType(Code) | | |
CP_String | final public static int CP_String(Code) | | |
CP_Utf8 | final public static int CP_Utf8(Code) | | |
ClassfileSourceRemapper | public ClassfileSourceRemapper(SourceMapExtractor smap, String inputClassFile, String outputClassFile, boolean bUseJSR45)(Code) | | Parameters: smap - A Source-to-source mapping. Parameters: inputClassFile - An input class file. Parameters: outputClassFile - An output class file. Parameters: bUseJSR45 - Wheather or not to use JSR45 SMAP for remapping. |
doRemapping | public void doRemapping() throws IOException(Code) | | Update the line number mapping in the class file.
|
main | public static void main(String[] args)(Code) | | Run the class file remapping process by taking a user command line.
Parameters: args - The command line arguments. |
|
|