|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.dellroad.jc.cgen.JCObjectGenerator
The default JC object file generator class. This class uses a
CodeGenerator
to generate C source and header files,
then compiles them into ELF object files using GCC.
The generated source files are expected to contain initial
double-slash comment lines with @dep_header
tags
for each required header file and @dep_class
tags
for each class file on which the generated source depends.
Constructor Summary | |
JCObjectGenerator()
Instantiate an object with an instance of SootCodeGenerator using a custom SourceLocator
as the underlying source file generator, and use system properties
to determine where source and object files go, whether to be
verbose, and what MethodOptimizer to use. |
|
JCObjectGenerator(CodeGenerator codeGenerator,
String sourcePath,
boolean verbose,
boolean debugSymbols,
boolean sourcesOnly,
boolean force)
Instantiate an object using the supplied configuration. |
Method Summary | |
File |
cFile(String className,
int i)
Return the file that contains the C source code for the class. |
void |
generateObject(String className,
ClassfileFinder finder,
File objectFile)
Generate object file using analysis via Soot. |
File |
hFile(String className,
int i)
Return the file that contains the C header source for the class. |
boolean |
objectIsValid(String className,
ClassfileFinder finder,
File objectFile)
Determine if an ELF object file is valid for the named class and all other classes (available through the provided finder ) on which the object file may depend. |
long |
parseHash(String s)
Parse an unsigned 8 byte hex value. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JCObjectGenerator()
SootCodeGenerator
using a custom SourceLocator
as the underlying source file generator, and use system properties
to determine where source and object files go, whether to be
verbose, and what MethodOptimizer
to use. This constructor
should only be used when JC is the JVM.
public JCObjectGenerator(CodeGenerator codeGenerator, String sourcePath, boolean verbose, boolean debugSymbols, boolean sourcesOnly, boolean force)
codeGenerator
- Object that can generate JC C source code.sourcePath
- Search path for C source and header files.
First component of path is where newly generated files go.verbose
- Whether to print verbose output to standard errordebugSymbols
- Whether to compile with the -g
flag.sourcesOnly
- If true
generate sources only,
don't compile them into ELF objects.Method Detail |
public void generateObject(String className, ClassfileFinder finder, File objectFile) throws Exception
This method is synchronized because Soot is not reentrant.
generateObject
in interface ObjectGenerator
className
- Class name (with slashes, not dots)finder
- Object capable of retrieving class filesobjectFile
- Where to put resulting ELF object
Exception
public boolean objectIsValid(String className, ClassfileFinder finder, File objectFile) throws Exception
ObjectGenerator
finder
) on which the object file may depend.
objectIsValid
in interface ObjectGenerator
className
- Class name (with slashes, not dots)finder
- Class finder capable of retrieving class filesobjectFile
- Where to put resulting ELF object
Exception
public File cFile(String className, int i)
public File hFile(String className, int i)
public long parseHash(String s) throws NumberFormatException
NumberFormatException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |